robinheghan / elm-warrior / Warrior.History

Every warrior's turn is recorded into History. You can use this module to answer questions about the past.


type alias History =
Warrior.Internal.History.History

The History record. It contains all past actions, and the previous states of warriors and the map

roundsPlayed : History -> Basics.Int

How many complete rounds have been played? A round is over when every warrior has taken an action.

previousStates : Warrior -> History -> List ( Warrior, Warrior.Map.Map )

Returns a list of the state of a warrior and the map, going back to the first turn. The first element in the list will represent the state of the warrior and the map at the beginning of that warrior's last turn.

previousActions : Warrior -> History -> List Warrior.Action

A list of every action a warrior has ever taken. The first element will be the previous action, the last element the first action.