History

public class History implements DeepEquatable

Constructors

History

public History()

Methods

addPlayer

public void addPlayer(int i)

deepEquals

public boolean deepEquals(Object other)

getObserverHistory

public PlayerHistory getObserverHistory()

The observer history. This is expected to be at least as complete as the union of all other PlayerHistory objects.

Returns:A PlayerHistory representing the view of an observer.

getPlayerHistories

public Collection<PlayerHistory> getPlayerHistories()

Get all of the player histories

Returns:A collection of all non-observer PlayerHistory objects.

getPlayerHistory

public PlayerHistory getPlayerHistory(int playerNumber)

Get the PlayerHistory for a specific player

Parameters:
  • playerNumber
Returns:

The PlayerHistory for the player if it exists, null otherwise.

getView

public HistoryView getView(int player)

hasFogOfWar

public boolean hasFogOfWar()

recordBirth

public void recordBirth(Unit newunit, Unit builder, State state)

recordCommandFeedback

public void recordCommandFeedback(int player, int stepnumber, ActionResult commandFeedback)

recordCommandRecieved

public void recordCommandRecieved(int player, int stepnumber, int unitID, Action actionRecieved)

recordDamage

public void recordDamage(Unit u, Unit target, int damage, State state)

recordDeath

public void recordDeath(Unit u, State state)

recordPrimitiveFeedback

public void recordPrimitiveFeedback(int player, int stepnumber, ActionResult primitiveFeedback)

recordResourceDropoff

public void recordResourceDropoff(Unit u, Unit townHall, State state)

recordResourceNodeExhaustion

public void recordResourceNodeExhaustion(ResourceNode r, State state)

recordResourcePickup

public void recordResourcePickup(Unit u, ResourceNode resource, int amountPickedUp, State state)

recordUpgrade

public void recordUpgrade(UpgradeTemplate upgradetemplate, Unit creator, State state)

setFogOfWar

public void setFogOfWar(boolean fogOfWar)

setObserverHistory

public void setObserverHistory(PlayerHistory oh)

Set the playerHistory for the observer directly. Used internally for loading.

Parameters:
  • oh – A player history for the observer.

setPlayerHistory

public void setPlayerHistory(PlayerHistory ph)

Set/Add a playerHistory directly. Used internally for loading.

Parameters:
  • ph