@@ -16,9 +16,11 @@ type ConfigSpecial struct {
16
16
BreakAfter time.Duration `yaml:"break-after"`
17
17
}
18
18
19
- // ConfigGlobal holds configs that are valid for the whole game
20
- type ConfigGlobal struct {
19
+ // ConfigGame holds configs that are valid for the whole game
20
+ type ConfigGame struct {
21
21
YellowCardDuration time.Duration `yaml:"yellow-card-duration"`
22
+ Normal ConfigSpecial `yaml:"normal"`
23
+ Overtime ConfigSpecial `yaml:"overtime"`
22
24
}
23
25
24
26
// ConfigPublish holds configs for publishing the state and commands to the teams
@@ -28,10 +30,8 @@ type ConfigPublish struct {
28
30
29
31
// Config structure for the game controller
30
32
type Config struct {
31
- Publish ConfigPublish `yaml:"publish"`
32
- Global ConfigGlobal `yaml:"global"`
33
- Normal ConfigSpecial `yaml:"normal"`
34
- Overtime ConfigSpecial `yaml:"overtime"`
33
+ Publish ConfigPublish `yaml:"publish"`
34
+ Game ConfigGame `yaml:"game"`
35
35
}
36
36
37
37
// LoadConfig loads a config from given file
@@ -58,19 +58,19 @@ func LoadConfig(fileName string) (config Config, err error) {
58
58
// DefaultConfig creates a config with default values
59
59
func DefaultConfig () (c Config ) {
60
60
c .Publish .Address = "224.5.23.1:10003"
61
- c .Global .YellowCardDuration = 2 * time .Minute
62
-
63
- c .Normal .HalfDuration = 5 * time .Minute
64
- c .Normal .HalfTimeDuration = 5 * time .Minute
65
- c .Normal .Timeouts = 4
66
- c .Normal .TimeoutDuration = 5 * time .Minute
67
- c .Normal .BreakAfter = 5 * time .Minute
68
-
69
- c .Overtime .HalfDuration = 2 * time .Minute + 30 * time .Second
70
- c .Overtime .HalfTimeDuration = 2 * time .Minute
71
- c .Overtime .Timeouts = 2
72
- c .Overtime .TimeoutDuration = 5 * time .Minute
73
- c .Overtime .BreakAfter = 2 * time .Minute
61
+ c .Game .YellowCardDuration = 2 * time .Minute
62
+
63
+ c .Game . Normal .HalfDuration = 5 * time .Minute
64
+ c .Game . Normal .HalfTimeDuration = 5 * time .Minute
65
+ c .Game . Normal .Timeouts = 4
66
+ c .Game . Normal .TimeoutDuration = 5 * time .Minute
67
+ c .Game . Normal .BreakAfter = 5 * time .Minute
68
+
69
+ c .Game . Overtime .HalfDuration = 2 * time .Minute + 30 * time .Second
70
+ c .Game . Overtime .HalfTimeDuration = 2 * time .Minute
71
+ c .Game . Overtime .Timeouts = 2
72
+ c .Game . Overtime .TimeoutDuration = 5 * time .Minute
73
+ c .Game . Overtime .BreakAfter = 2 * time .Minute
74
74
75
75
return
76
76
}
0 commit comments