game.ai
Class AbstractAI

java.lang.Object
  |
  +--game.ai.AbstractAI
All Implemented Interfaces:
AI
Direct Known Subclasses:
ComputerAI, PlayerAI

public abstract class AbstractAI
extends java.lang.Object
implements AI

Abstract class to hold information common to computer and player directed civilizations.


Nested Class Summary
 class AbstractAI.BuildData
           
 
Field Summary
protected  java.util.List combatReports
          List of combat square reports.
 
Constructor Summary
AbstractAI(Civilization _civilization)
          Constructor.
 
Method Summary
 void carryOutOrders()
          Carry out orders.
protected  void clearBuiltMap()
           
 void completeTurn()
          Perform any tidy up work at end of turn.
 Civilization getCivilization()
          Return the civiliztaion.
 boolean isBuilt(java.lang.String value)
          Return true if the named buildable object has been built.
 void notifyBuilding(Buildable buildable, java.lang.Object object, Square square, boolean success)
          Notify the AI that building has taken place.
 void studyCombatReport(CombatReport report)
          Study combat reports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface game.interfaces.AI
activatedTechnology, issueOrders, newTechnologyLevel
 

Field Detail

combatReports

protected java.util.List combatReports
List of combat square reports.

Constructor Detail

AbstractAI

public AbstractAI(Civilization _civilization)
Constructor.

Parameters:
_civilization - the owning civilization.
Method Detail

carryOutOrders

public void carryOutOrders()
Carry out orders.

Specified by:
carryOutOrders in interface AI

getCivilization

public Civilization getCivilization()
Return the civiliztaion.

Specified by:
getCivilization in interface AI
Returns:
the civiliztaion.

completeTurn

public void completeTurn()
Perform any tidy up work at end of turn.

Specified by:
completeTurn in interface AI

notifyBuilding

public void notifyBuilding(Buildable buildable,
                           java.lang.Object object,
                           Square square,
                           boolean success)
Notify the AI that building has taken place.

Specified by:
notifyBuilding in interface AI
Parameters:
buildable - the buildable class.
object - the actual object that has been built.
square - the place where built.

isBuilt

public boolean isBuilt(java.lang.String value)
Description copied from interface: AI
Return true if the named buildable object has been built.

Specified by:
isBuilt in interface AI
Returns:
true if the named buildable object has been built.

clearBuiltMap

protected void clearBuiltMap()

studyCombatReport

public void studyCombatReport(CombatReport report)
Study combat reports.

Specified by:
studyCombatReport in interface AI
Parameters:
report - the combat report to study.