PlayerState

public class PlayerState implements Serializable, DeepEquatable

Fields

playerNum

public final int playerNum

Constructors

PlayerState

public PlayerState(int id)

Methods

addTemplate

public void addTemplate(Template template)

addToCurrentResourceAmount

public void addToCurrentResourceAmount(ResourceType type, int increase)

addToCurrentSupply

public void addToCurrentSupply(int increase)

addToCurrentSupplyCap

public void addToCurrentSupplyCap(int increase)

addUnit

public void addUnit(Unit unit)

deepEquals

public boolean deepEquals(Object other)

getCurrentResourceAmount

public int getCurrentResourceAmount(ResourceType type)

getCurrentSupply

public int getCurrentSupply()

getCurrentSupplyCap

public int getCurrentSupplyCap()

Returns the maximum supply earned by the player.

getTemplate

public Template getTemplate(int id)

getTemplate

public Template getTemplate(String name)

getTemplates

public Map<Integer, Template> getTemplates()

getUnit

public Unit getUnit(int id)

getUnits

public Map<Integer, Unit> getUnits()

getUpgrades

public Set<Integer> getUpgrades()

getView

public StateView getView()

getVisibilityMatrix

public int[][] getVisibilityMatrix()

setCurrentResourceAmount

public void setCurrentResourceAmount(ResourceType type, int amount)

setCurrentSupply

public void setCurrentSupply(int supply)

setCurrentSupplyCap

public void setCurrentSupplyCap(int supply)

setStateView

public void setStateView(StateView view)

setVisibilityMatrix

public void setVisibilityMatrix(int[][] matrix)