wyvern.lib.classes
Class Ship.ShipMover

java.lang.Object
  extended bywyvern.kernel.motion.Mover
      extended bywyvern.kernel.motion.WaterMover
          extended bywyvern.lib.classes.Ship.ShipMover
Enclosing class:
Ship

public class Ship.ShipMover
extends WaterMover

This class determines where the ship is allowed to move.


Field Summary
 
Fields inherited from class wyvern.kernel.motion.Mover
FASTEST_MOVE_SPEED
 
Constructor Summary
Ship.ShipMover()
           
 
Method Summary
 int getSpeed(Commandable m, Terrain t)
          Gets the speed across this Terrain.
 boolean terrainCheck(GameObject agent, Terrain t, java.util.List objects, int x, int y)
          Returns true if the ship can move into the specified square.
 
Methods inherited from class wyvern.kernel.motion.WaterMover
canMove
 
Methods inherited from class wyvern.kernel.motion.Mover
canWalk, checkAllLocations, checkPreconditions, getInstance, isWater, setNoPassDelay, terrainCheckBlockedBy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ship.ShipMover

public Ship.ShipMover()
Method Detail

terrainCheck

public boolean terrainCheck(GameObject agent,
                            Terrain t,
                            java.util.List objects,
                            int x,
                            int y)
Returns true if the ship can move into the specified square.

Overrides:
terrainCheck in class Mover
Parameters:
agent - the ship
t - the Terrain in question
objects - the other objects at that location (can be null)
x - the x location
y - the y location
Returns:
true if the square can be entered; false if not. We can't move there if:
  • the terrain isn't water, or,
  • there is any kind of blocking object in the square

getSpeed

public int getSpeed(Commandable m,
                    Terrain t)
Gets the speed across this Terrain.

Overrides:
getSpeed in class Mover
Parameters:
m - the agent that's trying to move
t - the terrain into which the agent is moving
Returns:
the speed at which the agent may move across that t