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 {
454454 }
455455 } else if m .CanPlaceBall != nil {
456456 teamState .CanPlaceBall = * m .CanPlaceBall
457+ } else if m .BotInterchangeIntend != nil {
458+ teamState .BotInterchangeIntend = * m .BotInterchangeIntend
457459 } else {
458460 return errors .Errorf ("Unknown modify: %v" , m )
459461 }
Original file line number Diff line number Diff line change @@ -114,6 +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"`
117118}
118119
119120func (m EventModifyValue ) String () string {
Original file line number Diff line number Diff line change @@ -245,6 +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"`
248249}
249250
250251type 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 5353 <TeamBallPlacement
5454 :team-color =" teamColor" />
5555 </div >
56+ <div >
57+ <TeamBotInterchange
58+ :team-color =" teamColor" />
59+ </div >
5660 <div >
5761 Max <b >{{maxAllowedBots}}</b > bots allowed on the field
5862 </div >
7175 import TeamRedCards from " ./TeamRedCards" ;
7276 import TeamCounters from " ./TeamCounters" ;
7377 import TeamBallPlacement from " ./TeamBallPlacement" ;
78+ import TeamBotInterchange from " ./TeamBotInterchange" ;
7479
7580 export default {
7681 name: " TeamOverview" ,
7782 components: {
83+ TeamBotInterchange,
7884 TeamBallPlacement,
7985 TeamCounters,
8086 TeamRedCards,
You can’t perform that action at this time.
0 commit comments