Skip to content

Commit c0032d9

Browse files
committed
Initialize UI with a more reasonable production state
1 parent 8db0721 commit c0032d9

File tree

1 file changed

+64
-45
lines changed

1 file changed

+64
-45
lines changed

src/main.js

Lines changed: 64 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,71 @@ Vue.config.productionTip = false;
2222

2323
Vue.use(Vuex);
2424

25-
const store = new Vuex.Store({
26-
state: {
27-
refereeMsg: new Referee({
28-
yellow: new Referee.TeamInfo({
29-
name: 'Yellow',
30-
score: 0,
31-
yellowCards: 10,
32-
yellowCardTimes: [15000000, 61000000, 120000000, 1],
33-
maxAllowedBots: 11,
34-
}),
35-
blue: new Referee.TeamInfo({
36-
name: 'Blue',
37-
score: 10,
38-
maxAllowedBots: 6,
39-
}),
40-
stage: 6,
41-
command: 3,
42-
stageTimeLeft: 140000000,
43-
gameEvents: [
44-
{
45-
origin: ['TIGERs AutoRef', 'ER-Force', 'Majority'],
46-
attackerTooCloseToDefenseArea: {
47-
byTeam: 1,
48-
byBot: 1,
49-
distance: 0.2,
50-
}
51-
},
52-
{
53-
origin: ['TIGERs AutoRef', 'UI'],
54-
botKickedBallTooFast: {
55-
byTeam: 2,
56-
byBot: 1,
57-
initialBallSpeed: 42.0,
58-
chipped: true,
59-
}
60-
},
61-
{
62-
origin: ['ER-Force'],
63-
ballLeftFieldTouchLine: {
64-
byTeam: 1,
65-
byBot: 1,
66-
}
25+
let state;
26+
if (process.env.NODE_ENV === 'development') {
27+
state = {
28+
refereeMsg: new Referee({
29+
yellow: new Referee.TeamInfo({
30+
name: 'Yellow',
31+
score: 0,
32+
yellowCards: 10,
33+
yellowCardTimes: [15000000, 61000000, 120000000, 1],
34+
maxAllowedBots: 11,
35+
}),
36+
blue: new Referee.TeamInfo({
37+
name: 'Blue',
38+
score: 10,
39+
maxAllowedBots: 6,
40+
}),
41+
stage: 6,
42+
command: 3,
43+
stageTimeLeft: 140000000,
44+
gameEvents: [
45+
{
46+
origin: ['TIGERs AutoRef', 'ER-Force', 'Majority'],
47+
attackerTooCloseToDefenseArea: {
48+
byTeam: 1,
49+
byBot: 1,
50+
distance: 0.2,
51+
}
52+
},
53+
{
54+
origin: ['TIGERs AutoRef', 'UI'],
55+
botKickedBallTooFast: {
56+
byTeam: 2,
57+
byBot: 1,
58+
initialBallSpeed: 42.0,
59+
chipped: true,
6760
}
68-
]
69-
})
70-
},
61+
},
62+
{
63+
origin: ['ER-Force'],
64+
ballLeftFieldTouchLine: {
65+
byTeam: 1,
66+
byBot: 1,
67+
}
68+
}
69+
]
70+
})
71+
};
72+
} else {
73+
state = {
74+
refereeMsg: new Referee({
75+
yellow: new Referee.TeamInfo({
76+
name: 'Yellow',
77+
}),
78+
blue: new Referee.TeamInfo({
79+
name: 'Blue',
80+
}),
81+
stage: 0,
82+
command: 0,
83+
stageTimeLeft: 0,
84+
})
85+
}
86+
}
87+
88+
const store = new Vuex.Store({
89+
state: state,
7190
mutations: {
7291
SOCKET_ONOPEN() {
7392
// empty

0 commit comments

Comments
 (0)