File tree Expand file tree Collapse file tree 5 files changed +53
-0
lines changed Expand file tree Collapse file tree 5 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -454,6 +454,8 @@ func (e *Engine) processTeamModify(m *EventModifyValue) error {
454
454
}
455
455
} else if m .CanPlaceBall != nil {
456
456
teamState .CanPlaceBall = * m .CanPlaceBall
457
+ } else if m .BotInterchangeIntend != nil {
458
+ teamState .BotInterchangeIntend = * m .BotInterchangeIntend
457
459
} else {
458
460
return errors .Errorf ("Unknown modify: %v" , m )
459
461
}
Original file line number Diff line number Diff line change @@ -114,6 +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
118
}
118
119
119
120
func (m EventModifyValue ) String () string {
Original file line number Diff line number Diff line change @@ -245,6 +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
249
}
249
250
250
251
type GameEventBehavior string
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <label >Intends to interchange a bot: </label >
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" />
7
+ </a >
8
+ </div >
9
+ </template >
10
+
11
+ <script >
12
+ export default {
13
+ name: " TeamBotInterchange" ,
14
+ props: {
15
+ teamColor: String
16
+ },
17
+ methods: {
18
+ edit : function () {
19
+ this .$socket .sendObj ({
20
+ ' modify' : {
21
+ ' forTeam' : this .teamColor ,
22
+ ' botInterchangeIntend' : ! this .botInterchangeIntend
23
+ }
24
+ })
25
+ }
26
+ },
27
+ computed: {
28
+ teamState : function () {
29
+ return this .$store .state .refBoxState .teamState [this .teamColor ]
30
+ },
31
+ botInterchangeIntend () {
32
+ return this .teamState .botInterchangeIntend ;
33
+ },
34
+ }
35
+ }
36
+ </script >
37
+
38
+ <style scoped>
39
+ .btn-edit {
40
+ margin-left : 0.3em ;
41
+ margin-right : 0.3em ;
42
+ }
43
+ </style >
Original file line number Diff line number Diff line change 53
53
<TeamBallPlacement
54
54
:team-color =" teamColor" />
55
55
</div >
56
+ <div >
57
+ <TeamBotInterchange
58
+ :team-color =" teamColor" />
59
+ </div >
56
60
<div >
57
61
Max <b >{{maxAllowedBots}}</b > bots allowed on the field
58
62
</div >
71
75
import TeamRedCards from " ./TeamRedCards" ;
72
76
import TeamCounters from " ./TeamCounters" ;
73
77
import TeamBallPlacement from " ./TeamBallPlacement" ;
78
+ import TeamBotInterchange from " ./TeamBotInterchange" ;
74
79
75
80
export default {
76
81
name: " TeamOverview" ,
77
82
components: {
83
+ TeamBotInterchange,
78
84
TeamBallPlacement,
79
85
TeamCounters,
80
86
TeamRedCards,
You can’t perform that action at this time.
0 commit comments