make all decisions before enacting any
This commit is contained in:
parent
1dbe8786b3
commit
879260f719
|
@ -5,9 +5,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateState(s State, sOld State) State {
|
func UpdateState(s State, sOld State) State {
|
||||||
|
cmds := make([]command, len(s.Teams))
|
||||||
for i := range s.Teams {
|
for i := range s.Teams {
|
||||||
cmd := smartChooseCommand(s, i)
|
cmd := smartChooseCommand(s, i)
|
||||||
log.Printf("team %d chose to %v", i, cmd)
|
log.Printf("team %d chose to %v", i, cmd)
|
||||||
|
cmds[i] = cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, cmd := range cmds {
|
||||||
s = doCommand(cmd, s, i)
|
s = doCommand(cmd, s, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue