com.springrts.ai.oo
Class Engine

java.lang.Object
  extended by com.springrts.ai.oo.Engine
All Implemented Interfaces:
Comparable<Engine>

public class Engine
extends Object
implements Comparable<Engine>


Method Summary
 int compareTo(Engine other)
           
 boolean equals(Object otherObject)
           
 Version getVersion()
           
 int handleCommand(int toId, int commandId, AICommand command)
          Whenever an AI wants to change the engine state in any way, it has to call this method.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Engine other)
Specified by:
compareTo in interface Comparable<Engine>

equals

public boolean equals(Object otherObject)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

handleCommand

public int handleCommand(int toId,
                         int commandId,
                         AICommand command)
Whenever an AI wants to change the engine state in any way, it has to call this method. In other words, all commands from AIs to the engine (and other AIs) go through this method.

Parameters:
teamId - the team number of the AI that sends the command
toId - the team number of the AI that should receive the command, or COMMAND_TO_ID_ENGINE if it is addressed to the engine
commandId - used on asynchronous commands, this allows the AI to identify a possible result event, which would come with the same id
commandTopic - unique identifier of a command (see COMMAND_* defines in AISCommands.h)
commandData - a commandTopic specific struct, which contains the data associated with the command (see *Command structs)
Returns:
0: if command handling ok != 0: something else otherwise

getVersion

public Version getVersion()