Skip to content

Commit 9879bcd

Browse files
committed
feature: Make team names configurable
1 parent 42fcb29 commit 9879bcd

File tree

5 files changed

+120
-68
lines changed

5 files changed

+120
-68
lines changed

config/engine.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,36 @@
2727
"POSSIBLE_GOAL": "BEHAVIOR_ACCEPT"
2828
},
2929
"autoRefConfigs": {
30-
}
30+
},
31+
"teams": [
32+
"",
33+
"AIS",
34+
"AMC",
35+
"CMμs",
36+
"ER-Force",
37+
"Immortals",
38+
"KIKS",
39+
"MCT Susano Logics",
40+
"MRL",
41+
"nAMeC",
42+
"NEUIslanders",
43+
"OMID",
44+
"OP-AmP",
45+
"Parsian",
46+
"RobôCIn",
47+
"RoboDragons",
48+
"RoboFEI",
49+
"RoboIME",
50+
"RoboJackets",
51+
"RoboTeam Twente",
52+
"SRC",
53+
"SSH",
54+
"STOx’s",
55+
"Test Team",
56+
"TIGERs Mannheim",
57+
"ULtron",
58+
"UMass Minutebots",
59+
"UBC Thunderbots",
60+
"ZJUNlict"
61+
]
3162
}

internal/app/engine/ssl_gc_engine_config.pb.go

Lines changed: 45 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/ssl_gc_engine_config.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ message Config {
66
map<string, Behavior> game_event_behavior = 1;
77
map<string, AutoRefConfig> auto_ref_configs = 2;
88
optional string active_tracker_source = 3;
9+
// The list of available teams
10+
repeated string teams = 4;
911

1012
enum Behavior {
1113
BEHAVIOR_UNKNOWN = 0;

src/components/settings/team/TeamName.vue

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,9 @@
99

1010
<script>
1111
import EditableLabelSelect from "../../common/EditableLabelSelect";
12-
import {submitChange} from "../../../submit";
12+
import {submitChange} from "@/submit";
1313
1414
export const TEAMS = [
15-
"",
16-
"AIS",
17-
"AMC",
18-
"CMμs",
19-
"ER-Force",
20-
"Immortals",
21-
"KIKS",
22-
"MCT Susano Logics",
23-
"MRL",
24-
"nAMeC",
25-
"NEUIslanders",
26-
"OMID",
27-
"OP-AmP",
28-
"Parsian",
29-
"RobôCIn",
30-
"RoboDragons",
31-
"RoboFEI",
32-
"RoboIME",
33-
"RoboJackets",
34-
"RoboTeam Twente",
35-
"SRC",
36-
"SSH",
37-
"STOx’s",
38-
"Test Team",
39-
"TIGERs Mannheim",
40-
"ULtron",
41-
"UMass Minutebots",
42-
"UBC Thunderbots",
43-
"ZJUNlict",
4415
];
4516
4617
export default {
@@ -55,7 +26,7 @@
5526
return this.$store.state.matchState.teamState[this.teamColor]
5627
},
5728
teams: function () {
58-
return TEAMS
29+
return this.$store.state.config.teams;
5930
}
6031
},
6132
methods: {

src/proto.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25697,6 +25697,7 @@ export const Config = $root.Config = (() => {
2569725697
* @property {Object.<string,Config.Behavior>|null} [gameEventBehavior] Config gameEventBehavior
2569825698
* @property {Object.<string,IAutoRefConfig>|null} [autoRefConfigs] Config autoRefConfigs
2569925699
* @property {string|null} [activeTrackerSource] Config activeTrackerSource
25700+
* @property {Array.<string>|null} [teams] Config teams
2570025701
*/
2570125702

2570225703
/**
@@ -25710,6 +25711,7 @@ export const Config = $root.Config = (() => {
2571025711
function Config(properties) {
2571125712
this.gameEventBehavior = {};
2571225713
this.autoRefConfigs = {};
25714+
this.teams = [];
2571325715
if (properties)
2571425716
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2571525717
if (properties[keys[i]] != null)
@@ -25740,6 +25742,14 @@ export const Config = $root.Config = (() => {
2574025742
*/
2574125743
Config.prototype.activeTrackerSource = "";
2574225744

25745+
/**
25746+
* Config teams.
25747+
* @member {Array.<string>} teams
25748+
* @memberof Config
25749+
* @instance
25750+
*/
25751+
Config.prototype.teams = $util.emptyArray;
25752+
2574325753
/**
2574425754
* Creates a new Config instance using the specified properties.
2574525755
* @function create
@@ -25774,6 +25784,9 @@ export const Config = $root.Config = (() => {
2577425784
}
2577525785
if (message.activeTrackerSource != null && message.hasOwnProperty("activeTrackerSource"))
2577625786
writer.uint32(/* id 3, wireType 2 =*/26).string(message.activeTrackerSource);
25787+
if (message.teams != null && message.teams.length)
25788+
for (let i = 0; i < message.teams.length; ++i)
25789+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.teams[i]);
2577725790
return writer;
2577825791
};
2577925792

@@ -25827,6 +25840,11 @@ export const Config = $root.Config = (() => {
2582725840
case 3:
2582825841
message.activeTrackerSource = reader.string();
2582925842
break;
25843+
case 4:
25844+
if (!(message.teams && message.teams.length))
25845+
message.teams = [];
25846+
message.teams.push(reader.string());
25847+
break;
2583025848
default:
2583125849
reader.skipType(tag & 7);
2583225850
break;
@@ -25892,6 +25910,13 @@ export const Config = $root.Config = (() => {
2589225910
if (message.activeTrackerSource != null && message.hasOwnProperty("activeTrackerSource"))
2589325911
if (!$util.isString(message.activeTrackerSource))
2589425912
return "activeTrackerSource: string expected";
25913+
if (message.teams != null && message.hasOwnProperty("teams")) {
25914+
if (!Array.isArray(message.teams))
25915+
return "teams: array expected";
25916+
for (let i = 0; i < message.teams.length; ++i)
25917+
if (!$util.isString(message.teams[i]))
25918+
return "teams: string[] expected";
25919+
}
2589525920
return null;
2589625921
};
2589725922

@@ -25951,6 +25976,13 @@ export const Config = $root.Config = (() => {
2595125976
}
2595225977
if (object.activeTrackerSource != null)
2595325978
message.activeTrackerSource = String(object.activeTrackerSource);
25979+
if (object.teams) {
25980+
if (!Array.isArray(object.teams))
25981+
throw TypeError(".Config.teams: array expected");
25982+
message.teams = [];
25983+
for (let i = 0; i < object.teams.length; ++i)
25984+
message.teams[i] = String(object.teams[i]);
25985+
}
2595425986
return message;
2595525987
};
2595625988

@@ -25967,6 +25999,8 @@ export const Config = $root.Config = (() => {
2596725999
if (!options)
2596826000
options = {};
2596926001
let object = {};
26002+
if (options.arrays || options.defaults)
26003+
object.teams = [];
2597026004
if (options.objects || options.defaults) {
2597126005
object.gameEventBehavior = {};
2597226006
object.autoRefConfigs = {};
@@ -25986,6 +26020,11 @@ export const Config = $root.Config = (() => {
2598626020
}
2598726021
if (message.activeTrackerSource != null && message.hasOwnProperty("activeTrackerSource"))
2598826022
object.activeTrackerSource = message.activeTrackerSource;
26023+
if (message.teams && message.teams.length) {
26024+
object.teams = [];
26025+
for (let j = 0; j < message.teams.length; ++j)
26026+
object.teams[j] = message.teams[j];
26027+
}
2598926028
return object;
2599026029
};
2599126030

0 commit comments

Comments
 (0)