Sprout basic command infrastructure

This commit is contained in:
Luke Meyers 2020-02-05 20:49:29 -08:00
parent c8c9451e51
commit 894c487390
1 changed files with 15 additions and 1 deletions

View File

@ -70,7 +70,11 @@ func UpdateState(sOld State) State {
s := sOld s := sOld
for i, t := range s.Teams { for i, t := range s.Teams {
accelerate(t.Baton.Holder) switch chooseCommand(t, sOld) {
case speedUp:
accelerate(t.Baton.Holder)
}
moveBot(t.Baton.Holder, sOld) moveBot(t.Baton.Holder, sOld)
maybePassBaton(&s.Teams[i]) maybePassBaton(&s.Teams[i])
} }
@ -84,6 +88,16 @@ func UpdateState(sOld State) State {
return s return s
} }
func chooseCommand(t Team, s State) command {
return speedUp
}
type command int
const (
speedUp command = iota
)
func maybePassBaton(t *Team) { func maybePassBaton(t *Team) {
for i, b := range t.Bots { for i, b := range t.Bots {
h := t.Baton.Holder h := t.Baton.Holder