Java Universal Role Playing Engine Version 0.3.9

jurpe.dungeon
Class Avatar

java.lang.Object
  extended by jurpe.dungeon.Avatar
All Implemented Interfaces:
IDungeonPawn

public final class Avatar
extends java.lang.Object
implements IDungeonPawn

Avatar placeholder. This is the current position of the player in the game map (RpgMap)

See Also:
Placeholder, RpgMap

Method Summary
 void enableGunsight(boolean enabled)
          Gunsight (aim mode).
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
 Gunsight getGunsight()
          Aim gunsight
 Level getLevel()
          Get Avatar level
 Placeholder getPlaceholder()
          Get Avatar placeholder
 int getZLevel()
          Get the underground level of the Avatar.
 boolean hasGunsight()
          If the Avatar has started an aim mode.
 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
 

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()
Get Avatar level

Returns:
Level

getPlaceholder

public Placeholder getPlaceholder()
Get Avatar placeholder

Specified by:
getPlaceholder in interface IDungeonPawn

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


enableGunsight

public void enableGunsight(boolean enabled)
Gunsight (aim mode). If enabled, a new placeholder has to be generated.

Parameters:
enabled - If true, enables aim mode. Else exit aim mode.

hasGunsight

public boolean hasGunsight()
If the Avatar has started an aim mode.

Returns:
true if avatar has an active gunsight (ie, it is in aim mode)

getGunsight

public Gunsight getGunsight()
Aim gunsight

Returns:
Aim gunsight object

Java Universal Role Playing Engine Version 0.3.9

Copyright ? 2010 http://jurpe.sourceforge.net/ All Rights Reserved.