This repository has been archived by the owner on Nov 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclasses_enums.nut
95 lines (87 loc) · 1.86 KB
/
classes_enums.nut
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
enum StationDirection
{
x_is_constant__horizontal,
y_is_constant__vertical
}
class Station
{
location = null;
direction = null;
is_city = null;
connection = null;
area_blocked_by_station = null;
}
enum RouteType
{
rawCargo,
processedCargo,
townCargo,
}
class Route
{
start = null;
end = null;
forbidden_industries = null;
depot_tile = null;
start_tile = null;
end_tile = null;
cargo = null;
production = null;
type = null;
station_size = null;
station_direction = null;
first_station = null;
second_station = null;
track_type = null;
engine = null;
engine_count = null;
budget = null;
demand = null;
OK = null;
constructor()
{
first_station = Station();
second_station = Station();
start=null;
end=null;
forbidden_industries = AIList();
depot_tile = null;
start_tile = null;
end_tile = null;
cargo = null;
production = null;
type = null;
station_size = null;
engine = null;
engine_count = null;
budget = null;
}
function StationsAllocated()
{
return first_station.location != null && second_station.location != null
}
function proper_clone()
{
local returned = Route();
returned.start = start;
returned.end = end;
returned.forbidden_industries = forbidden_industries; //note that this is NOT cloned and everything links to the same list
returned.depot_tile = depot_tile;
returned.start_tile = start_tile;
returned.end_tile = end_tile;
returned.cargo = cargo;
returned.production = production;
returned.type = type;
returned.station_size = station_size;
returned.station_direction = station_direction;
returned.first_station = clone first_station;
returned.second_station = clone second_station;
returned.track_type = track_type;
returned.engine = engine;
returned.engine_count = engine_count;
returned.budget = budget;
returned.demand = demand;
returned.OK = OK;
return returned;
}
}