@@ -75,26 +75,29 @@ func (r *RobotSpecSetter) handleRobotSpecs() {
75
75
func (r * RobotSpecSetter ) updateTeam (team referee.Team , teamName string ) {
76
76
if r .appliedTeams [team ] != teamName {
77
77
if spec , ok := r .teamRobotSpecs .Teams [teamName ]; ok {
78
- protoSpec := mapRobotSpec (spec )
79
- protoSpec .Id = new (referee.RobotId )
80
- protoSpec .Id .Id = new (uint32 )
81
- protoSpec .Id .Team = new (referee.Team )
82
- * protoSpec .Id .Id = 0
83
- * protoSpec .Id .Team = team
84
- r .sendConfig (protoSpec )
78
+ var protoSpecs []* RobotSpecs
79
+ for id := 0 ; id < 16 ; id ++ {
80
+ protoSpec := mapRobotSpec (spec )
81
+ protoSpec .Id = new (referee.RobotId )
82
+ protoSpec .Id .Id = new (uint32 )
83
+ protoSpec .Id .Team = new (referee.Team )
84
+ * protoSpec .Id .Team = team
85
+ * protoSpec .Id .Id = uint32 (id )
86
+ protoSpecs = append (protoSpecs , protoSpec )
87
+ }
88
+ r .sendConfig (protoSpecs )
85
89
r .appliedTeams [team ] = teamName
86
90
}
87
91
}
88
92
}
89
93
90
- func (r * RobotSpecSetter ) sendConfig (robotSpec * RobotSpecs ) {
94
+ func (r * RobotSpecSetter ) sendConfig (robotSpec [] * RobotSpecs ) {
91
95
log .Printf ("Sending robot spec %v" , robotSpec )
92
96
93
97
command := SimulatorCommand {
94
98
Config : & SimulatorConfig {
95
- RobotSpecs : []* RobotSpecs {
96
- robotSpec ,
97
- }},
99
+ RobotSpecs : robotSpec ,
100
+ },
98
101
}
99
102
100
103
if data , err := proto .Marshal (& command ); err != nil {
0 commit comments