-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplane_type.go
147 lines (116 loc) · 2.55 KB
/
plane_type.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package main
type PlaneType struct {
mark rune
name string
weight int
ticks_per_move Ticks
moves_per_tick int
ticks_pending Ticks
ticks_rolling Ticks
entry_min_height int
entry_max_height int
exit_height int
initial_fuel Ticks
immediate_turn bool
can_hoover bool
can_enter_nofly bool
entry_exit_routes bool
airport_loop bool
airport_entry bool
airport_exit bool
}
var (
PLANE_TYPE_JET = PlaneType{
mark: 'J',
name: "Jet",
weight: 12,
ticks_per_move: 1,
moves_per_tick: 1,
ticks_pending: 4,
ticks_rolling: 2,
entry_min_height: 6,
entry_max_height: 9,
exit_height: 5,
initial_fuel: 15 * Minutes,
immediate_turn: false,
can_hoover: false,
entry_exit_routes: true,
airport_loop: false,
airport_entry: true,
airport_exit: true,
}
PLANE_TYPE_PROP = PlaneType{
mark: 'P',
name: "Prop",
weight: 8,
ticks_per_move: 2,
moves_per_tick: 1,
ticks_pending: 4,
ticks_rolling: 4,
entry_min_height: 6,
entry_max_height: 9,
exit_height: 5,
initial_fuel: 21 * Minutes,
immediate_turn: false,
can_hoover: false,
entry_exit_routes: true,
airport_loop: true,
airport_entry: true,
airport_exit: true,
}
PLANE_TYPE_HELI = PlaneType{
mark: 'H',
name: "Heli",
weight: 2,
ticks_per_move: 2,
moves_per_tick: 1,
ticks_pending: 4,
ticks_rolling: 0,
entry_min_height: 2,
entry_max_height: 4,
exit_height: 5,
initial_fuel: 15 * Minutes,
immediate_turn: true,
can_hoover: true,
entry_exit_routes: false,
airport_loop: false,
airport_entry: true,
airport_exit: true,
}
PLANE_TYPE_BLACKBIRD = PlaneType{
mark: 'B',
name: "Blackbird",
weight: 1,
ticks_per_move: 1,
moves_per_tick: 2,
ticks_pending: 2,
ticks_rolling: 0,
entry_min_height: 10,
entry_max_height: 10,
exit_height: 10,
initial_fuel: 15 * Minutes,
immediate_turn: false,
can_hoover: false,
can_enter_nofly: true,
entry_exit_routes: true,
airport_loop: false,
airport_entry: false,
airport_exit: false,
}
)
func PlaneTypes(rules *GameRules) []*PlaneType {
plane_types := make([]*PlaneType, 0, 3)
if rules.have_jet {
plane_types = append(plane_types, &PLANE_TYPE_JET)
}
if rules.have_prop {
plane_types = append(plane_types, &PLANE_TYPE_PROP)
}
if rules.have_heli {
plane_types = append(plane_types, &PLANE_TYPE_HELI)
}
if rules.have_blackbird {
plane_types = append(plane_types, &PLANE_TYPE_BLACKBIRD)
}
return plane_types
}