cz.cuni.amis.pogamut.defcon.ai
Class AbstractAI

Package class diagram package AbstractAI
java.lang.Object
  extended by cz.cuni.amis.pogamut.defcon.ai.AbstractAI
All Implemented Interfaces:
IUnitAI
Direct Known Subclasses:
AbstractBuildingAI

public abstract class AbstractAI
extends Object
implements IUnitAI

Implementation of common features for all units.

Author:
Radek 'Black_Hand' Pibil

Field Summary
 DefConAgentLogicController<?> logic
           
 int unitId
           
 WorldObjectId worldObjectId
           
 
Constructor Summary
AbstractAI(DefConAgentLogicController<?> logic, WorldObjectId worldObjectId)
           
 
Method Summary
protected  void act(DefConCommand command)
          Simplifies posting of commands.
 void dispose()
          Unregisters ai from all places.
 WorldObjectId getId()
          Returns the WorldObjectId of the associated unit.
 void receiveMessage(IMessage message)
          Receives a message from mailbox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.defcon.ai.IUnitAI
getLocation, update
 

Field Detail

logic

public final DefConAgentLogicController<?> logic

unitId

public final int unitId

worldObjectId

public final WorldObjectId worldObjectId
Constructor Detail

AbstractAI

public AbstractAI(DefConAgentLogicController<?> logic,
                  WorldObjectId worldObjectId)
Method Detail

receiveMessage

public void receiveMessage(IMessage message)
Description copied from interface: IUnitAI
Receives a message from mailbox.

Specified by:
receiveMessage in interface IUnitAI

getId

public WorldObjectId getId()
Description copied from interface: IUnitAI
Returns the WorldObjectId of the associated unit.

Specified by:
getId in interface IUnitAI
Returns:

act

protected final void act(DefConCommand command)
Simplifies posting of commands.

Parameters:
command -

dispose

public void dispose()
Description copied from interface: IUnitAI
Unregisters ai from all places. ALWAYS CALL SUPER.DISPOSE!

Specified by:
dispose in interface IUnitAI


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.