game.interfaces
Interface Buildable

All Known Implementing Classes:
UnitArchetype, WallArchetype

public interface Buildable

Buildable interface for objects that are built by the economy or by file input. Providing cost parameters of the buildable, and a createInstance method for the economy to call when the object is built and requires instantiation by the model that created a Buildable object. On instantiation each buildable object must register itself with the economics package by calling Ecomomics.registerBuildable(this)


Method Summary
 Square buildSquare(Administration administration)
          Return a legal square in which the object can be built, if it exists, otherwise return null.
 java.lang.Object createInstance(Civilization civ, Square square)
          Called by economy or by file input to instantiate the buildable object in a particular square.
 java.lang.Object createInstance(TaskForce taskForce)
          Called by file input to create scenario units.
 java.lang.String getBuildableCategory()
          Returns the category of Buildable.
 Cost getCost()
          Provides Economy with cost information on this type of buildable object.
 java.lang.String getName()
          Return the name of the object that is buildable.
 

Method Detail

getCost

public Cost getCost()
Provides Economy with cost information on this type of buildable object.

Returns:
the cost.

createInstance

public java.lang.Object createInstance(Civilization civ,
                                       Square square)
Called by economy or by file input to instantiate the buildable object in a particular square.

Returns:
the newly built object.

createInstance

public java.lang.Object createInstance(TaskForce taskForce)
Called by file input to create scenario units.

Parameters:
taskForce - the taskForce associated with the new unit.
Returns:
the newly built object.

buildSquare

public Square buildSquare(Administration administration)
Return a legal square in which the object can be built, if it exists, otherwise return null.

Returns:
a legal square in which the object can be built, if it exists, otherwise return null.

getName

public java.lang.String getName()
Return the name of the object that is buildable.

Returns:
the name of the object that is buildable.

getBuildableCategory

public java.lang.String getBuildableCategory()
Returns the category of Buildable. Categories should be the same as those defined in GovtEconOrdersInfo