diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-07 22:52:25 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-07 22:52:25 +0200 |
commit | 239571e3408a3187953bef1dd5d516461bad0e31 (patch) | |
tree | 67c062a635affc90c08a92ac61adfed2445985d8 /src/main/scala/Model/Entity.scala | |
parent | def8975617e5c6da431e41cc889d167b0f2e2bb0 (diff) | |
download | scalevalapokalypsi-239571e3408a3187953bef1dd5d516461bad0e31.tar.gz scalevalapokalypsi-239571e3408a3187953bef1dd5d516461bad0e31.zip |
Added turns, time limits and turn order randomization (feature/bug?)
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() = |