diff options
Diffstat (limited to 'src/main/scala/Model/Entity.scala')
-rw-r--r-- | src/main/scala/Model/Entity.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/scala/Model/Entity.scala b/src/main/scala/Model/Entity.scala index eb19606..c18ffea 100644 --- a/src/main/scala/Model/Entity.scala +++ b/src/main/scala/Model/Entity.scala @@ -47,6 +47,14 @@ class Entity(val name: String, initialLocation: Area): s"You drop the $itemName" case None => "You don't have that!" + /** Tells whether this entity can drop the specified item + * (if an action were to specify so). + * + * @param itemName the name to check + * @return whether this entity has this item and can drop it + */ + def canDrop(itemName: String): Boolean = this.inventory.contains(itemName) + /** Causes the player to rest for a short while (this has no substantial effect in game terms). * Returns a description of what happened. */ def rest() = |