State.StateBuilder

public static class StateBuilder

Constructors

StateBuilder

public StateBuilder()

Methods

addPlayer

public void addPlayer(PlayerState player)

addResource

public void addResource(ResourceNode r)

addTemplate

public void addTemplate(Template t)

addUnit

public void addUnit(Unit u, int x, int y)

build

public State build()

Completes construction of the state and returns a reference to the state. Subsequent calls to this method will result in returning null.

Returns:
  • the state being built if this is the first call for this object, null otherwise

closed

public boolean closed()

getTemplate

public Template getTemplate(int player, String name)

getTextString

public String getTextString()

hasTemplates

public boolean hasTemplates(int player)

positionAvailable

public boolean positionAvailable(int x, int y)

setIDDistributerTargetMax

public void setIDDistributerTargetMax(int newmax)

setIDDistributerTemplateMax

public void setIDDistributerTemplateMax(int newmax)

setResourceAmount

public void setResourceAmount(int player, ResourceType resource, int amount)

setSize

public void setSize(int x, int y)

setSupplyCap

public void setSupplyCap(int player, int supply)

setTurn

public void setTurn(int turn)