stub state

This commit is contained in:
Bel LaPointe
2021-02-21 23:22:49 -06:00
parent 7216ac1620
commit 3954d3cc6a
6 changed files with 125 additions and 0 deletions

36
game/state/state.go Normal file
View File

@@ -0,0 +1,36 @@
package state
type State struct {
Players []PlayerState
Cards []CardState
}
func (state State) Copy() State {
return State{
Players: append([]PlayerState{}, state.Players...),
Cards: append([]CardState{}, state.Cards...),
}
}
func (state State) RedactLiberal() State {
return state.Redact(LIBERAL)
}
func (state State) RedactFacist() State {
return state.Redact(FACIST)
}
func (state State) RedactHitler() State {
return state.Redact(HITLER)
}
func (state State) Redact(alignment Alignment) State {
state2 := state.Copy()
for i := range state2.Players {
state2.Players[i] = state2.Players[i].Redact(alignment)
}
for i := range state2.Cards {
state2.Cards[i] = state2.Cards[i].Redact(alignment)
}
return state2
}