gamedom1.agent
Class SmartMove

java.lang.Object
  extended by gamedom1.agent.SmartMove
All Implemented Interfaces:
ClientCommandIF

public class SmartMove
extends java.lang.Object
implements ClientCommandIF

This class does SmartMove and SmartAttack. (move/attack + pathfinding + replanning when needed.) A bit of patchwork, as smart attacking was an afterthought. smartAttack.isActive is true when (smart)attacking, false when (smart)moving. This class could be on the infiniteWisdom package as well as a utility class, as it's quite handy and reusable.


Nested Class Summary
 class SmartMove.SmartMOverlayDrawer
          Displays the results of pathfinding.
 
Constructor Summary
SmartMove(UnitIF rec, UnitIF enemy, double dist)
           
SmartMove(UnitIF rec, Vec2f g)
           
 
Method Summary
 Vec2f getGoal()
           
 UnitIF getReceiver()
           
 SmartMove.SmartMOverlayDrawer getSMOverlayDrawer(GameWorldView gwv)
           
 ServerCommand step()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartMove

public SmartMove(UnitIF rec,
                 Vec2f g)
          throws GridPathFinder.PathNotExistsException
Throws:
GridPathFinder.PathNotExistsException

SmartMove

public SmartMove(UnitIF rec,
                 UnitIF enemy,
                 double dist)
          throws GridPathFinder.PathNotExistsException
Throws:
GridPathFinder.PathNotExistsException
Method Detail

step

public ServerCommand step()
Specified by:
step in interface ClientCommandIF

getReceiver

public UnitIF getReceiver()
Specified by:
getReceiver in interface ClientCommandIF

getGoal

public Vec2f getGoal()

getSMOverlayDrawer

public SmartMove.SmartMOverlayDrawer getSMOverlayDrawer(GameWorldView gwv)