File tree Expand file tree Collapse file tree 4 files changed +18
-10
lines changed
Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,11 @@ func (e *Engine) UndoLastAction() {
8686}
8787
8888func (e * Engine ) Continue () {
89- if e .State .NextCommand != CommandUnknown {
89+ if e .State .BotSubstitutionIntend () {
90+ e .State .TeamState [TeamBlue ].BotSubstitutionIntend = false
91+ e .State .TeamState [TeamYellow ].BotSubstitutionIntend = false
92+ e .SendCommand (CommandHalt , "" )
93+ } else if e .State .NextCommand != CommandUnknown {
9094 e .SendCommand (e .State .NextCommand , e .State .NextCommandFor )
9195 }
9296}
@@ -454,8 +458,8 @@ func (e *Engine) processTeamModify(m *EventModifyValue) error {
454458 }
455459 } else if m .CanPlaceBall != nil {
456460 teamState .CanPlaceBall = * m .CanPlaceBall
457- } else if m .BotInterchangeIntend != nil {
458- teamState .BotInterchangeIntend = * m .BotInterchangeIntend
461+ } else if m .BotSubstitutionIntend != nil {
462+ teamState .BotSubstitutionIntend = * m .BotSubstitutionIntend
459463 } else {
460464 return errors .Errorf ("Unknown modify: %v" , m )
461465 }
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ type EventModifyValue struct {
114114 Division * Division `json:"division,omitempty"`
115115 AutoContinue * bool `json:"autoContinue,omitempty"`
116116 GameEventBehavior * EventModifyGameEventBehavior `json:"gameEventBehavior,omitempty"`
117- BotInterchangeIntend * bool `json:"botInterchangeIntend ,omitempty"`
117+ BotSubstitutionIntend * bool `json:"botSubstitutionIntend ,omitempty"`
118118}
119119
120120func (m EventModifyValue ) String () string {
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ type TeamInfo struct {
245245 CanPlaceBall bool `json:"canPlaceBall"`
246246 MaxAllowedBots int `json:"maxAllowedBots"`
247247 Connected bool `json:"connected"`
248- BotInterchangeIntend bool `json:"botInterchangeIntend "`
248+ BotSubstitutionIntend bool `json:"botSubstitutionIntend "`
249249}
250250
251251type GameEventBehavior string
@@ -334,6 +334,10 @@ func (s State) GameState() GameState {
334334 return ""
335335}
336336
337+ func (s State ) BotSubstitutionIntend () bool {
338+ return s .TeamState [TeamYellow ].BotSubstitutionIntend || s .TeamState [TeamBlue ].BotSubstitutionIntend
339+ }
340+
337341func newTeamInfo () (t TeamInfo ) {
338342 t .Name = ""
339343 t .Goals = 0
Original file line number Diff line number Diff line change 22 <div >
33 <label >Intends to interchange a bot: </label >
44 <a class =" btn-edit" v-on:click =" edit()" >
5- <font-awesome-icon icon =" toggle-on" v-if =" botInterchangeIntend " />
6- <font-awesome-icon icon =" toggle-off" v-if =" !botInterchangeIntend " />
5+ <font-awesome-icon icon =" toggle-on" v-if =" botSubstitutionIntend " />
6+ <font-awesome-icon icon =" toggle-off" v-if =" !botSubstitutionIntend " />
77 </a >
88 </div >
99</template >
1919 this .$socket .sendObj ({
2020 ' modify' : {
2121 ' forTeam' : this .teamColor ,
22- ' botInterchangeIntend ' : ! this .botInterchangeIntend
22+ ' botSubstitutionIntend ' : ! this .botSubstitutionIntend
2323 }
2424 })
2525 }
2828 teamState : function () {
2929 return this .$store .state .refBoxState .teamState [this .teamColor ]
3030 },
31- botInterchangeIntend () {
32- return this .teamState .botInterchangeIntend ;
31+ botSubstitutionIntend () {
32+ return this .teamState .botSubstitutionIntend ;
3333 },
3434 }
3535 }
You can’t perform that action at this time.
0 commit comments