-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.go
89 lines (78 loc) · 2.06 KB
/
json.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package main
import (
"GoConsoleBT/controller"
"time"
)
type MinMax struct {
Min, Max float64
}
type GameConfig struct {
ColWidth float64 `json:"colWidth"`
RowHeight float64 `json:"rowHeight"`
LockfreePool bool `json:"lockfreePool"`
KeyBindings []controller.KeyBind `json:"keyBindings"`
Box Box `json:"box"`
disableCustomization bool
}
func NewDefaultGameConfig() (*GameConfig, error) {
return &GameConfig{
ColWidth: 1,
RowHeight: 1,
LockfreePool: true,
KeyBindings: []controller.KeyBind{
controller.Player1DefaultKeyBinding,
controller.Player2DefaultKeyBinding,
},
Box: Box{
Point{
X: 0,
Y: 0,
},
Size{
W: 267,
H: 63,
},
},
}, nil
}
type AnimationConfig struct {
SpriteerConfig
Duration time.Duration `json:"duration"`
RepeatDuration time.Duration `json:"repeatDuration"`
Cycled bool `json:"cycled"`
Blink time.Duration `json:"blink"`
Length int `json:"length"`
Reversed bool `json:"reversed"`
Defaults map[string]interface{} `json:"defaults"`
}
type SpriteerConfig struct {
Type string `json:"type"`
Name string `json:"name"`
Path string `json:"path"`
Custom CustomizeMap `json:"custom"`
IsTransparent bool `json:"transparent"`
IsAbsolute bool `json:"absolute"`
}
type SpriteConfig struct {
SpriteerConfig
}
type CompositionLayerConfig struct {
SpriteerConfig
ZIndex int `json:"zIndex"`
OffsetX int `json:"offsetX"`
OffsetY int `json:"offsetY"`
}
type CompositionConfig struct {
SpriteerConfig
Defaults map[string]interface{} `json:"defaults"`
}
type MotionObjectConfig struct {
Direction Point
Speed MinMax
AccelTime time.Duration `json:"accelTime"`
AccelTimeFunc string `json:"accelTimeFunc"`
}
type SizeConfig struct {
W float64 `json:"w"`
H float64 `json:"h"`
}