infinitewisdom.model.util
Class ServerUnitIFAdapter

java.lang.Object
  extended by infinitewisdom.model.util.ServerUnitIFAdapter
All Implemented Interfaces:
ServerUnitIF, UnitIF, java.io.Serializable
Direct Known Subclasses:
Archer, Swordsman

public class ServerUnitIFAdapter
extends java.lang.Object
implements ServerUnitIF

Usually you only override the constructor of this.

See Also:
Serialized Form

Field Summary
protected  double attackpoint
           
protected  int coolDown
           
protected  int coolDownTimer
           
protected  GameWorld gameWorld
           
protected  Vec2f goal
           
protected  double hitpoint
           
protected static long idcounter
           
protected  long idnum
           
protected  java.lang.String name
           
protected  PlayerIF player
           
protected  Vec2f pos
           
protected  double range
           
protected  double shield
           
protected  double size
           
protected  double speed
           
protected  UnitStateE state
           
 
Constructor Summary
ServerUnitIFAdapter(PlayerIF player, Vec2f pos)
           
 
Method Summary
 boolean collide(Vec2f tmppos)
          Returns true if there's a collision.
 void commandAttack(ServerUnitIF enemy)
           
 void commandMove(Vec2f p)
           
 void commandStop()
           
 boolean doesDamage()
           
 double getAttackPoints()
           
 double getAttackRange()
           
 int getCoolDown()
           
 UnitIF getEnemy()
           
 GameWorld getGameWorld()
           
 Vec2f getGoal()
           
 double getHitPoints()
           
 long getId()
           
 PlayerIF getPlayer()
           
 Vec2f getPosition()
           
 double getShield()
           
 double getSize()
           
 double getSpeed()
           
 UnitStateE getState()
           
 void setAttackPoints(double d)
           
 void setAttackRange(double d)
           
 void setCoolDown(int cd)
           
 void setGameWorld(GameWorld gw)
           
 void setHitPoints(double d)
           
 void setPlayer(PlayerIF p)
           
 void setPosition(Vec2f p)
           
 void setShield(double d)
           
 void setSpeed(double d)
           
 void setState(UnitStateE s)
           
 void step()
          Timestep of simulation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

idcounter

protected static long idcounter

idnum

protected long idnum

name

protected java.lang.String name

hitpoint

protected double hitpoint

attackpoint

protected double attackpoint

speed

protected double speed

shield

protected double shield

range

protected double range

pos

protected Vec2f pos

goal

protected Vec2f goal

state

protected UnitStateE state

player

protected PlayerIF player

size

protected double size

gameWorld

protected GameWorld gameWorld

coolDown

protected int coolDown

coolDownTimer

protected int coolDownTimer
Constructor Detail

ServerUnitIFAdapter

public ServerUnitIFAdapter(PlayerIF player,
                           Vec2f pos)
Method Detail

getId

public long getId()
Specified by:
getId in interface UnitIF

commandAttack

public void commandAttack(ServerUnitIF enemy)
Specified by:
commandAttack in interface ServerUnitIF

commandMove

public void commandMove(Vec2f p)
Specified by:
commandMove in interface ServerUnitIF

commandStop

public void commandStop()
Specified by:
commandStop in interface ServerUnitIF

collide

public boolean collide(Vec2f tmppos)
Returns true if there's a collision.

Specified by:
collide in interface ServerUnitIF

step

public void step()
Description copied from interface: ServerUnitIF
Timestep of simulation.

Specified by:
step in interface ServerUnitIF

getAttackPoints

public double getAttackPoints()
Specified by:
getAttackPoints in interface UnitIF

getAttackRange

public double getAttackRange()
Specified by:
getAttackRange in interface UnitIF

getHitPoints

public double getHitPoints()
Specified by:
getHitPoints in interface UnitIF

getPlayer

public PlayerIF getPlayer()
Specified by:
getPlayer in interface UnitIF

getPosition

public Vec2f getPosition()
Specified by:
getPosition in interface UnitIF

getShield

public double getShield()
Specified by:
getShield in interface UnitIF

getSpeed

public double getSpeed()
Specified by:
getSpeed in interface UnitIF

getState

public UnitStateE getState()
Specified by:
getState in interface UnitIF

setAttackPoints

public void setAttackPoints(double d)
Specified by:
setAttackPoints in interface ServerUnitIF

setAttackRange

public void setAttackRange(double d)
Specified by:
setAttackRange in interface ServerUnitIF

setHitPoints

public void setHitPoints(double d)
Specified by:
setHitPoints in interface ServerUnitIF

setPlayer

public void setPlayer(PlayerIF p)
Specified by:
setPlayer in interface ServerUnitIF

setPosition

public void setPosition(Vec2f p)
Specified by:
setPosition in interface ServerUnitIF

setShield

public void setShield(double d)
Specified by:
setShield in interface ServerUnitIF

setSpeed

public void setSpeed(double d)
Specified by:
setSpeed in interface ServerUnitIF

setState

public void setState(UnitStateE s)
Specified by:
setState in interface ServerUnitIF

getSize

public double getSize()
Specified by:
getSize in interface UnitIF

getGameWorld

public GameWorld getGameWorld()
Specified by:
getGameWorld in interface UnitIF

toString

public java.lang.String toString()
Specified by:
toString in interface UnitIF
Overrides:
toString in class java.lang.Object

setGameWorld

public void setGameWorld(GameWorld gw)
Specified by:
setGameWorld in interface ServerUnitIF

getGoal

public Vec2f getGoal()
Specified by:
getGoal in interface ServerUnitIF

getEnemy

public UnitIF getEnemy()
Specified by:
getEnemy in interface ServerUnitIF

doesDamage

public boolean doesDamage()
Specified by:
doesDamage in interface ServerUnitIF

getCoolDown

public int getCoolDown()
Specified by:
getCoolDown in interface UnitIF

setCoolDown

public void setCoolDown(int cd)
Specified by:
setCoolDown in interface ServerUnitIF