org.deken.game.movement
Class BaseMovement

java.lang.Object
  extended by org.deken.game.movement.BaseMovement
All Implemented Interfaces:
Movement, Updateable
Direct Known Subclasses:
FourKeyMovement, MouseDragMovement, SimpleMovement, ToCorner4Movement, ToTile4Movement, TwoKeyMovement, Wander8Movement

public abstract class BaseMovement
extends java.lang.Object
implements Movement

Title: BaseAnimation

Description: Base class for holding the GameVector and name.

Copyright: Copyright (c) Sep 26, 2014

Version:
1.0
Author:
Gary Deken

Field Summary
protected  GameVector gameVector
           
protected  java.lang.String name
           
 
Constructor Summary
BaseMovement()
           
 
Method Summary
protected  void baseCopy(Movement newMovement)
           
 float getDirection()
          This returns the direction from the GameVector.
 GameVector getGameVector()
          This returns the GameVector.
 java.lang.String getName()
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deken.game.movement.Movement
collideHorizontal, collideLayer, collideVertical, copy, getXUpdate, getYUpdate, update
 

Field Detail

gameVector

protected GameVector gameVector

name

protected java.lang.String name
Constructor Detail

BaseMovement

public BaseMovement()
Method Detail

baseCopy

protected void baseCopy(Movement newMovement)

getDirection

public float getDirection()
This returns the direction from the GameVector.

Specified by:
getDirection in interface Movement
Returns:
float

getGameVector

public GameVector getGameVector()
This returns the GameVector. It is recommended to use getDirection() for getting the direction, instead of going through the GameVector, to insure the GameVector is not changed outside of the Movement class.

Specified by:
getGameVector in interface Movement
Returns:
GameVector

getName

public java.lang.String getName()
Specified by:
getName in interface Updateable
Returns:

setName

public void setName(java.lang.String name)