jurpe.dungeon
Class Avatar

java.lang.Object
  extended by jurpe.dungeon.Avatar

public final class Avatar
extends java.lang.Object

Avatar placeholder.

See Also:
PlaceHolder

Constructor Summary
Avatar()
           
 
Method Summary
static Avatar getAvatar(java.util.Random rnd, Dungeons dng)
          Creates a new Avatar.
 java.awt.Color getAvatarBackground()
          Get Avatar background color
 java.awt.Color getAvatarColor()
          Get Avatar foreground color
 Direction getEdge(HexMap hexMap)
          Get the direction in which Avatar is getting close to the perimenter
 Level getLevel()
           
 PlaceHolder getPlaceHolder()
          Get Avatar's placeholder
 int getZLevel()
          Get the underground level of the Avatar.
 boolean isInVillage()
          Return true if the Avatar is in the village (dungeon level 0)
 void move(Direction d)
          Move avatar in some direction
 void resetAvatar()
          Reset avatar
 void setInitialPosition(HexMap hexMap)
          Set Avatar initial position.
 void setLevel(Level lvl)
          Set avatar level
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Avatar

public Avatar()
Method Detail

getAvatar

public static Avatar getAvatar(java.util.Random rnd,
                               Dungeons dng)
Creates a new Avatar.

Parameters:
rnd - Random Random seed
dng - Dungeon Handle to dungeons
Returns:
Avatar Newly created avatar

getLevel

public Level getLevel()
Returns:
Level

getPlaceHolder

public PlaceHolder getPlaceHolder()
Get Avatar's placeholder

Returns:
Avatar's placeholder

getZLevel

public int getZLevel()
Get the underground level of the Avatar.

Returns:
Zero if Avatar is in the Village, 1 if he's in the first underground level and so on

setLevel

public void setLevel(Level lvl)
Set avatar level

Parameters:
lvl - Level

isInVillage

public boolean isInVillage()
Return true if the Avatar is in the village (dungeon level 0)

Returns:
True if the Avatar is in the village

getAvatarColor

public java.awt.Color getAvatarColor()
Get Avatar foreground color

Returns:
Avatar foreground color

getAvatarBackground

public java.awt.Color getAvatarBackground()
Get Avatar background color

Returns:
Avatar background color

move

public void move(Direction d)
          throws JurpeException
Move avatar in some direction

Parameters:
d - A direction, as in Direction class
Throws:
JurpeException

getEdge

public Direction getEdge(HexMap hexMap)
                  throws JurpeException
Get the direction in which Avatar is getting close to the perimenter

Returns:
the direction in which Avatar is getting close to the perimenter
Throws:
JurpeException

setInitialPosition

public void setInitialPosition(HexMap hexMap)
                        throws JurpeException
Set Avatar initial position.

Parameters:
hexMap - HexMap
Throws:
JurpeException

resetAvatar

public void resetAvatar()
Reset avatar


Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net