net.sf.mud4j.character
Class AbstractCharacter

java.lang.Object
  extended by net.sf.mud4j.character.AbstractCharacter
All Implemented Interfaces:
Character, Messageable, Damageable, Effectable
Direct Known Subclasses:
NonPlayerCharacter, PlayerCharacter

public class AbstractCharacter
extends java.lang.Object
implements Character

Abstract character implementation for character implementations to implement for default functions. Provides IoC mechanism to populate character information.

Author:
Matthew Purland

Constructor Summary
AbstractCharacter()
           
AbstractCharacter(java.lang.String characterName)
           
 
Method Summary
 java.util.List<CharacterAbility> getAbilities()
          Get character abilities that the character has.
 DamageBehavior getDamageBehavior()
          Get the defined damage behavior for the damageable entity.
 EffectBehavior getEffectBehavior()
          Get effect behavior to handle effects.
 java.util.List<Item> getItems()
          Get character items that the character has possession of.
 int getLevel()
          Get level of character.
 java.lang.String getName()
          Get the name of the character.
 boolean hasAbility(CharacterAbility ability)
          Determines if the character has an ability.
 boolean hasItem(Item item)
          Does the player have a particular item?
 void message(java.lang.String message)
          Message the character through the provided connection service.
 void setDamageBehavior(DamageBehavior damageBehavior)
          Sets the damage behavior for the damageable object.
 void setEffectBehavior(EffectBehavior effectBehavior)
          Set effect behavior on the effectable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCharacter

public AbstractCharacter()

AbstractCharacter

public AbstractCharacter(java.lang.String characterName)
Method Detail

getAbilities

public java.util.List<CharacterAbility> getAbilities()
Get character abilities that the character has.

Specified by:
getAbilities in interface Character
Returns:
Returns collection of character abilities.

getItems

public java.util.List<Item> getItems()
Get character items that the character has possession of.

Specified by:
getItems in interface Character
Returns:
Returns a list of items that the character has.

hasItem

public boolean hasItem(Item item)
Does the player have a particular item?

Specified by:
hasItem in interface Character
Parameters:
item - Item for which the player might have.
Returns:
Returns if the character has an item.

getName

public java.lang.String getName()
Get the name of the character.

Specified by:
getName in interface Character
Returns:
Returns the name of the character.

hasAbility

public boolean hasAbility(CharacterAbility ability)
Determines if the character has an ability.

Specified by:
hasAbility in interface Character
Returns:
Returns whether the character has an ability.

message

public void message(java.lang.String message)
             throws java.io.IOException
Message the character through the provided connection service.

Specified by:
message in interface Messageable
Throws:
java.io.IOException

getLevel

public int getLevel()
Get level of character.

Specified by:
getLevel in interface Character
Returns:
Returns the level of the character.

getEffectBehavior

public EffectBehavior getEffectBehavior()
Get effect behavior to handle effects.

Specified by:
getEffectBehavior in interface Effectable
Returns:
Returns the effect behavior.

setEffectBehavior

public void setEffectBehavior(EffectBehavior effectBehavior)
Set effect behavior on the effectable object.

Specified by:
setEffectBehavior in interface Effectable

getDamageBehavior

public DamageBehavior getDamageBehavior()
Get the defined damage behavior for the damageable entity.

Specified by:
getDamageBehavior in interface Damageable
Returns:
Returns the damage behavior for the damageable object.

setDamageBehavior

public void setDamageBehavior(DamageBehavior damageBehavior)
Sets the damage behavior for the damageable object.

Specified by:
setDamageBehavior in interface Damageable


Copyright © 2006-2007 mud4j. All Rights Reserved.