|
1 | 1 | <template> |
2 | 2 | <div class="match-status"> |
3 | 3 | <div> |
4 | | - <div :class="{'highlight-command': true, 'stop-command': isStop, 'halt-command': isHalt}"> |
| 4 | + <div :class="{'highlight-command': true, 'stop-command': isStop, 'halt-command': isHalt, 'robot-substitution': isRobotSubstitution}"> |
5 | 5 | <div class="stage">{{stage}}</div> |
6 | 6 |
|
7 | 7 | <span class="score"> |
|
32 | 32 | </template> |
33 | 33 |
|
34 | 34 | <script> |
35 | | - import {Referee} from "@/sslProto" |
| 35 | + import {Referee, GameEvent} from "@/sslProto" |
36 | 36 | import {mapStageToText, mapCommandToText} from "@/texts"; |
37 | 37 | import PowerPlay from "./PowerPlay"; |
38 | 38 |
|
|
44 | 44 | return this.$store.state.refereeMsg; |
45 | 45 | }, |
46 | 46 | isHalt() { |
47 | | - return this.refereeMessage.command === Referee.Command.HALT; |
| 47 | + return !this.isRobotSubstitution && this.refereeMessage.command === Referee.Command.HALT; |
48 | 48 | }, |
49 | 49 | isStop() { |
50 | | - return this.refereeMessage.command === Referee.Command.STOP; |
| 50 | + return !this.isRobotSubstitution && this.refereeMessage.command === Referee.Command.STOP; |
| 51 | + }, |
| 52 | + isRobotSubstitution() { |
| 53 | + if (this.refereeMessage.command !== Referee.Command.HALT) { |
| 54 | + return false; |
| 55 | + } |
| 56 | + for(const gameEvent of this.refereeMessage.gameEvents) { |
| 57 | + if (gameEvent.type === GameEvent.Type.BOT_SUBSTITUTION) { |
| 58 | + return true; |
| 59 | + } |
| 60 | + } |
| 61 | + return false; |
51 | 62 | }, |
52 | 63 | stage() { |
53 | 64 | return mapStageToText(this.refereeMessage.stage); |
54 | 65 | }, |
55 | 66 | gameState() { |
| 67 | + if (this.isRobotSubstitution) { |
| 68 | + return "Robot Substitution" |
| 69 | + } |
56 | 70 | return mapCommandToText(this.refereeMessage.command); |
57 | 71 | }, |
58 | 72 | isBallPlacement() { |
|
165 | 179 | background-color: #EE0022; |
166 | 180 | } |
167 | 181 |
|
| 182 | + .highlight-command.robot-substitution { |
| 183 | + background-color: #0053ee; |
| 184 | + } |
| 185 | +
|
168 | 186 | </style> |
0 commit comments