Class Person
Object
Person
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new item to the inventory of this person.Item[]
Returns items in the inventory of this character, based on description provided.getAttribute
(String name) getGuild()
Returns the guildname (not the full title!) of the guild.getMoney()
getName()
getRoom()
getSex()
Item[]
boolean
isAttribute
(String name) void
boolean
removeAttribute
(String name) void
removeItem
(Item item) Actually destroys an item from the inventory of this person.void
sendMessage
(String message) void
sendMessage
(Person toperson, String message) void
sendMessageExcl
(String message) Sends a message in the room, but not to myself.void
sendMessageExcl
(Person toperson, String message) Sends a message in the room, but not to myself and the target toperson.void
setAttribute
(String name, String value) void
boolean
transferMoney
(Integer newamount, Person target) Transfers money from one person (this one) to another.Returns the item that is being worn at that position.Returns the item that is being wielded at that position.
-
Constructor Details
-
Person
Constructor- Parameters:
person
- the original object to redirect calls to.
-
-
Method Details
-
getSex
-
getName
-
getRoom
-
setRoom
-
getGuild
Returns the guildname (not the full title!) of the guild. For example the guild Benefactors of Karchan will yield guildname "deputy".- Returns:
- The guildname.
-
getMoney
- Returns:
- See Also:
-
transferMoney
Transfers money from one person (this one) to another.- Parameters:
newamount
- the amount of copper (base currency to move)target
- the target that is to receive said money- Returns:
- boolean, false if the money amount is illegal, or the person simply does not have that much money.
-
personal
-
sendMessage
-
sendMessage
- Parameters:
message
-- See Also:
-
sendMessageExcl
Sends a message in the room, but not to myself.- Parameters:
message
-- See Also:
-
sendMessageExcl
-
wears
Returns the item that is being worn at that position. Returns null if nothing is being worn at that position.
For example:
wears("ON_HEAD") can return item "crown". The ON_HEAD is straight from
Wearing.ON_HEAD
.- Parameters:
position
- a String- Returns:
- an Item or null if nothing is worn.
- See Also:
-
wields
Returns the item that is being wielded at that position. Returns null if nothing is being wielded at that position.
For example:
wields("WIELD_LEFT") can return item "strong, iron pick". The WIELD_LEFT is straight from
Wielding.WIELD_LEFT
.- Parameters:
position
- a String- Returns:
- an Item or null if nothing is being wielded.
- See Also:
-
getAttribute
-
setAttribute
-
isAttribute
-
removeAttribute
-
addItem
Adds a new item to the inventory of this person. With new it is understood that the item was created with a call toItems.createItem(int)
, and is not yet allocated to a room, person or container.- Parameters:
item
- the new item to add.- Returns:
- the exact same item, or null if unable to comply.
-
findItems
-
removeItem
Actually destroys an item from the inventory of this person.- Parameters:
item
- the new item to destroy.
-
inventory
-