spellcast.beings
Interface IBeing

All Superinterfaces:
util.Nullable
All Known Subinterfaces:
IMonster, IWizard
All Known Implementing Classes:
Being, FireElemental, Giant, Goblin, IceElemental, Monster, NullBeing, NullMonster, NullWizard, Ogre, Troll, Wizard

public interface IBeing
extends util.Nullable

The Being Interface.

Version:
$Revision: 1.1 $
Author:
Barrie Treloar

Method Summary
 void addEnchantment(Enchantment anEnchantment)
          Add an enchantment to this Being.
 Enchantment[] getEnchantments()
          Return an array of all Enchantments that are in effect upon this Being.
 Gender getGender()
          Return the Gender of this Being.
 int getHitPoints()
          Returns the value of the current Hit Points for this Being.
 Id getId()
          The Id of this Being.
 boolean getLeavesCorpse()
          Indicates whether this Being should leave a corpse when it dies.
 int getMaxHitPoints()
          Returns the value for the Maximum Hit Points for this Being.
 java.lang.String getName()
          The name of the Being.
 boolean isActive()
          Indicates whether this Being is active this turn.
 boolean isAlive()
          Determine if this Being is currently alive.
 void removeEnchantment(Enchantment enchantment)
          Remove the specified Enchantment from this Being.
 void setActive(boolean isActive)
          Sets this Being as active for this turn.
 void setAlive(boolean isAlive)
          Sets whether this Being is currently alive.
 void setGender(Gender theGender)
          Sets the Gender of this Being.
 void setHitPoints(int theHitPoints)
          Set the value for the current HitPoints for this Being.
 void setId(Id theId)
          Set the Id of this Being.
 void setLeavesCorpse(boolean shouldLeaveCorpse)
          This Being will leave a corpse on death if this value is true, otherwise no corpse will be created.
 void setMaxHitPoints(int theMaxHitPoints)
          Set the value for the Maximum Hit Points for this Being.
 void setName(java.lang.String theName)
          Sets the name of this Being.
 void shouldDie()
          Determine if this being should die.
 void takeDamage(Damage damageDealt)
          The specified damage is dealt to this Being.
 void updateEnchantments()
          Each Enchantment on this Being is notified that the turn has been completed via turnComplete.
 
Methods inherited from interface util.Nullable
isNull
 

Method Detail

addEnchantment

void addEnchantment(Enchantment anEnchantment)
Add an enchantment to this Being.

Parameters:
anEnchantment - the enchantment to add.

removeEnchantment

void removeEnchantment(Enchantment enchantment)
Remove the specified Enchantment from this Being. If the enchantment does not exist then nothing is removed.

Parameters:
enchantment - the enchantment to remove. Ignored if the enchantment is not in effect on this Being.

getEnchantments

Enchantment[] getEnchantments()
Return an array of all Enchantments that are in effect upon this Being.

Returns:
an array of all Enchantments that are in effect upon this Being.

updateEnchantments

void updateEnchantments()
Each Enchantment on this Being is notified that the turn has been completed via turnComplete. If the Enchantment indicates that it should no longer be in effect then it is removed.

See Also:
Enchantment.turnComplete()

isActive

boolean isActive()
Indicates whether this Being is active this turn.

Returns:
whether this Being is active this turn.

setActive

void setActive(boolean isActive)
Sets this Being as active for this turn.

Parameters:
isActive - if thisBeing is active for this turn, false otherwise.

isAlive

boolean isAlive()
Determine if this Being is currently alive. True if alive, false otherwise.

Returns:
true if the Being is alive, false otherwise.

setAlive

void setAlive(boolean isAlive)
Sets whether this Being is currently alive. True if alive, false otherwise.

Parameters:
isAlive - true if alive, false otherwise.

shouldDie

void shouldDie()
Determine if this being should die. TODO this should probably return an object which indicates: who killed the Being and what killed them.


getId

Id getId()
The Id of this Being.

Returns:
the Id of this Being.

setId

void setId(Id theId)
Set the Id of this Being.

Parameters:
theId - the Id of this Being.

getHitPoints

int getHitPoints()
Returns the value of the current Hit Points for this Being. The current hit points will never exceed max hit points.

Returns:
the value of the current Hit Points for this Being.

setHitPoints

void setHitPoints(int theHitPoints)
Set the value for the current HitPoints for this Being. Any values that are negative are converted into 0. Any values that are greater than getMaxHitPoints are converted into getMaxHitPoints.

Parameters:
theHitPoints - the value to set the Hit Points to. Any negative values are converted to 0. Any values that are greater thangetMaxHitPoints are converted into getMaxHitPoints.

getMaxHitPoints

int getMaxHitPoints()
Returns the value for the Maximum Hit Points for this Being.

Returns:
the maximum hit points for this Being.

setMaxHitPoints

void setMaxHitPoints(int theMaxHitPoints)
Set the value for the Maximum Hit Points for this Being. Only positive values are allowed for maxHitPoints. Any invalid values are silently ignored and the value is set to 0.

Parameters:
theMaxHitPoints - the value to set the Maximum Hit Points to. Valid values are > 0. Invalid values are silently ignored and the value is set to 0.

takeDamage

void takeDamage(Damage damageDealt)
The specified damage is dealt to this Being. If there are any Enchantments that provide resistance to the DamageType being dealt then the damage is reduced to zero.

Parameters:
damageDealt - the damage to deal to this Being.

getName

java.lang.String getName()
The name of the Being.

Returns:
the name of the Being.

setName

void setName(java.lang.String theName)
Sets the name of this Being.

Parameters:
theName - the name for this Being.

getGender

Gender getGender()
Return the Gender of this Being.

Returns:
the Gender of this Being.

setGender

void setGender(Gender theGender)
Sets the Gender of this Being.

Parameters:
theGender - the Gender of this Being.

getLeavesCorpse

boolean getLeavesCorpse()
Indicates whether this Being should leave a corpse when it dies.

Returns:
true if a corpse should be created on death, false otherwise.

setLeavesCorpse

void setLeavesCorpse(boolean shouldLeaveCorpse)
This Being will leave a corpse on death if this value is true, otherwise no corpse will be created.

Parameters:
shouldLeaveCorpse - true if a corpse should be created on death, false otherwise.


Copyright © 2001-2005 Spellcast. All Rights Reserved.