   # TODO: prevent dropping items which haven't had description or room_description set
   def drop_item(username, args) do
     if length(args) < 1 do
-      IO.puts "What do you want to get?"
+      IO.puts "What do you want to drop?"
     else
       name_or_id = List.first(args)
       {:ok, player} = Exedra.User.get(username)

    end
  end

  def currency_text_singular() do
    "gold coin"
  end

  def currency_text_plural() do
    "gold coins"
  end

  def currency_color() do
    Exedra.ANSI.colors[:yellow]
  end

  def items(username) do
    {:ok, player} = Exedra.User.get(username)

  end

  # TODO use guards to reduce indentation
  @spec get_item(String.t, list(String.t)) :: :ok
  def get_item(_, args) when length(args) < 1, do: IO.puts "What do you want to get?"
  def get_item(username, args) do
    name_or_id = List.first(args)
    {:ok, player} = Exedra.User.get(username)
    {:ok, room} = Exedra.Room.get(player.room_id)
    case Integer.parse(name_or_id) do
      {id, _} ->
        get_item_by_id(player, room, id, args)
      :error ->
        name = name_or_id
        get_item_by_name(player, room, name, args)
    end
  end

  def get_item_msg(brief), do: "You pick up " <> brief <> "."
  def get_npc_fail_msg(brief), do: brief <> " stares at you awkwardly." # TODO capitalise NPC name?

  @spec get_item_by_id(Exedra.User.Data, Exedra.Room.Data, integer, list(String.t)) :: :ok
  def get_item_by_id(player, room, id, args) do
    cond do
      MapSet.member?(room.items, id) ->
        Exedra.Item.pickup(id, room, player)
        {:ok, item} = Exedra.Item.get(id)
        IO.puts get_item_msg(item.brief)
      MapSet.member?(room.npcs, id) ->
        {:ok, npc} = Exedra.NPC.get(id)
        # TODO: allow picking up NPCs with permissions
        # Exedra.NPC.pickup(id, room, player)
        # IO.puts "You pick up " <> item.brief <> "."
        IO.puts get_npc_fail_msg(npc.brief)
      true ->
        get_currency(player, args)
    end
  end

  @spec get_item_by_name(Exedra.User.Data, Exedra.Room.Data, String.t, list(String.t)) :: :ok
  def get_item_by_name(player, room, name, args) do
    item_id = Enum.find room.items, fn(item_id) ->
      {:ok, item} = Exedra.Item.get(item_id)
      item.name == name
    end
    if item_id != nil do
      Exedra.Item.pickup(item_id, room, player)
      {:ok, item} = Exedra.Item.get(item_id)
      IO.puts get_item_msg(item.brief)
    else
      get_npc_by_name(player, room, name, args)
    end
  end

  @spec get_npc_by_name(Exedra.User.Data, Exedra.Room.Data, String.t, list(String.t)) :: :ok
  def get_npc_by_name(player, room, name, args) do
    npc_id = Enum.find room.npcs, fn(npc_id) ->
      {:ok, npc} = Exedra.NPC.get(npc_id)
      npc.name == name
    end
    if npc_id != nil do
      {:ok, npc} = Exedra.NPC.get(npc_id)
      # TODO: fix duplication with get_item_by_id
      # TODO: allow picking up NPCs with permissions
      # Exedra.NPC.pickup(npc_id, room, player)
      IO.puts get_npc_fail_msg(npc.brief)
    else
      get_currency(player, args)
    end
  end

