Java Universal Role Playing Engine Version 0.3.9

jurpe.dungeon
Class Movement

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

public class Movement
extends java.lang.Object

The class Movement takes in input a direction in the current level, scan the cell in the destination and returns if the desired movement is allowed and a feedback string.


Constructor Summary
Movement(Level dungeonLevel, Cell fromCell, Direction dir)
          Create a movement instance
 
Method Summary
 boolean allowOverMonsters()
          True, if movement is allowed over monsters
 java.lang.String getFeedback()
          Get any communication from the destination cell (ie: there's a sign here...)
 java.lang.String getMonsterName()
          Get the monster name in the destination cell
 boolean isMovementAllowed()
          If the movement between the starting cell and the destination cell is allowed
 void setAllowOverMonsters(boolean allow)
          Allow movement over monsters and PC (ie: gunsight)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Movement

public Movement(Level dungeonLevel,
                Cell fromCell,
                Direction dir)
Create a movement instance

Parameters:
dungeonLevel - Current level
fromCell - Starting cell
dir - Direction from starting cell
toCell - Destination cell
Method Detail

getMonsterName

public java.lang.String getMonsterName()
Get the monster name in the destination cell

Returns:
Null, if no monster in the destination cell. Else, the monster name

getFeedback

public java.lang.String getFeedback()
Get any communication from the destination cell (ie: there's a sign here...)

Returns:
Any communication from the destination cell

isMovementAllowed

public boolean isMovementAllowed()
If the movement between the starting cell and the destination cell is allowed

Returns:
True if the movement toward destination is allowed

setAllowOverMonsters

public void setAllowOverMonsters(boolean allow)
Allow movement over monsters and PC (ie: gunsight)

Parameters:
allowOverMonsters - if true, isMovementAllowed returns true even in the cell is a monster

allowOverMonsters

public boolean allowOverMonsters()
True, if movement is allowed over monsters

Returns:

Java Universal Role Playing Engine Version 0.3.9

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