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() {
86
86
}
87
87
88
88
func (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 {
90
94
e .SendCommand (e .State .NextCommand , e .State .NextCommandFor )
91
95
}
92
96
}
@@ -454,8 +458,8 @@ func (e *Engine) processTeamModify(m *EventModifyValue) error {
454
458
}
455
459
} else if m .CanPlaceBall != nil {
456
460
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
459
463
} else {
460
464
return errors .Errorf ("Unknown modify: %v" , m )
461
465
}
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ type EventModifyValue struct {
114
114
Division * Division `json:"division,omitempty"`
115
115
AutoContinue * bool `json:"autoContinue,omitempty"`
116
116
GameEventBehavior * EventModifyGameEventBehavior `json:"gameEventBehavior,omitempty"`
117
- BotInterchangeIntend * bool `json:"botInterchangeIntend ,omitempty"`
117
+ BotSubstitutionIntend * bool `json:"botSubstitutionIntend ,omitempty"`
118
118
}
119
119
120
120
func (m EventModifyValue ) String () string {
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ type TeamInfo struct {
245
245
CanPlaceBall bool `json:"canPlaceBall"`
246
246
MaxAllowedBots int `json:"maxAllowedBots"`
247
247
Connected bool `json:"connected"`
248
- BotInterchangeIntend bool `json:"botInterchangeIntend "`
248
+ BotSubstitutionIntend bool `json:"botSubstitutionIntend "`
249
249
}
250
250
251
251
type GameEventBehavior string
@@ -334,6 +334,10 @@ func (s State) GameState() GameState {
334
334
return ""
335
335
}
336
336
337
+ func (s State ) BotSubstitutionIntend () bool {
338
+ return s .TeamState [TeamYellow ].BotSubstitutionIntend || s .TeamState [TeamBlue ].BotSubstitutionIntend
339
+ }
340
+
337
341
func newTeamInfo () (t TeamInfo ) {
338
342
t .Name = ""
339
343
t .Goals = 0
Original file line number Diff line number Diff line change 2
2
<div >
3
3
<label >Intends to interchange a bot: </label >
4
4
<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 " />
7
7
</a >
8
8
</div >
9
9
</template >
19
19
this .$socket .sendObj ({
20
20
' modify' : {
21
21
' forTeam' : this .teamColor ,
22
- ' botInterchangeIntend ' : ! this .botInterchangeIntend
22
+ ' botSubstitutionIntend ' : ! this .botSubstitutionIntend
23
23
}
24
24
})
25
25
}
28
28
teamState : function () {
29
29
return this .$store .state .refBoxState .teamState [this .teamColor ]
30
30
},
31
- botInterchangeIntend () {
32
- return this .teamState .botInterchangeIntend ;
31
+ botSubstitutionIntend () {
32
+ return this .teamState .botSubstitutionIntend ;
33
33
},
34
34
}
35
35
}
You can’t perform that action at this time.
0 commit comments