Class Human
java.lang.Object
org.progettoedids.entities.Entity
org.progettoedids.entities.npcs.NPC
org.progettoedids.entities.npcs.humans.Human
- All Implemented Interfaces:
InteractiveOnTurnStart
A Human is an NPC which is characterized by a certain
Item.
A Human is supposed to interact with the user at the beginning of each turn if the player is located in the same Room as the Human. The interaction consists in an exchange of an Item with the NPC, the Player can choose whether to accept the exchange offer or deny it. The Player cannot exchange an Item with the NPC is it doesn't hold any Item in its inventory.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinteractOnTurnStart(CommandLogger commandLogger, Labyrinth labyrinth) Interacts with the user.toString()Methods inherited from class org.progettoedids.entities.Entity
getName, getSystemName, getUUID, setName
-
Field Details
-
item
-
-
Constructor Details
-
Human
Initializes a Human.- Parameters:
systemName- The system name is used to uniquely identify a certain type of Human. Must not be nullname- The name is displayed to the user and is used to identify an instance of a Human by the user. Must not be nullitem- The item to be exchanged by the Human. Must not be null
-
-
Method Details
-
toString
-
interactOnTurnStart
Interacts with the user. A Human wants to exchange an Items it heals with one from the Player's inventory.If a Player doesn't have any items in his inventory then the exchange won't take place and the user is notified. After the exchange the Player holds the Human's item and the Human holds the item of the Player the user chose.
- Parameters:
commandLogger- the CommandLogger onto which the user typed commands are saved. Must not be nulllabyrinth- the Labyrinth on which the interaction actions are performed. Must not be null
-