-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatic-data.lua
132 lines (118 loc) · 5.33 KB
/
static-data.lua
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
local StaticData = {}
StaticData.entityNames = {}
local locoDetails = {
collision_box = {{-0.6, -0.8}, {0.6, 0.8}},
selection_box = {{-1, -1}, {1, 1}},
connection_distance = 3,
connection_snap_distance = 2,
joint_distance = 0.3
}
local centreWagonDetails = {
collision_box = {{-0.6, -0.9}, {0.6, 0.9}},
selection_box = {{-1, -1}, {1, 1}},
connection_distance = 0,
connection_snap_distance = 2,
joint_distance = 0.4
}
local placementDetails = {
collision_box = {{-0.6, -3.2}, {0.6, 3.2}},
selection_box = {{-1, -3}, {1, 3}},
connection_distance = 3,
connection_snap_distance = 2,
joint_distance = 4
}
StaticData.MakeName = function(staticData)
return "single_train_unit-" .. staticData.locoConfiguration .. "-" .. staticData.unitType .. "-" .. staticData.type
end
--[[
middle wagons and locos reference their placement via "placementStaticData".
placement references wagons and locos via "placedStaticDataWagon" and "placedStaticDataLoco".
All final parts have a "type".
]]
StaticData.DoubleEndCargoWagon = {
collision_box = centreWagonDetails.collision_box,
selection_box = centreWagonDetails.selection_box,
connection_distance = centreWagonDetails.connection_distance,
connection_snap_distance = centreWagonDetails.connection_snap_distance,
joint_distance = centreWagonDetails.joint_distance,
unitType = "cargo",
type = "wagon",
prototypeType = "cargo-wagon",
locoConfiguration = "double_end"
}
StaticData.DoubleEndCargoWagon.name = StaticData.MakeName(StaticData.DoubleEndCargoWagon)
StaticData.entityNames[StaticData.DoubleEndCargoWagon.name] = StaticData.DoubleEndCargoWagon
StaticData.DoubleEndCargoLoco = {
collision_box = locoDetails.collision_box,
selection_box = locoDetails.selection_box,
connection_distance = locoDetails.connection_distance,
connection_snap_distance = locoDetails.connection_snap_distance,
joint_distance = locoDetails.joint_distance,
unitType = "cargo",
type = "loco",
prototypeType = "locomotive",
locoConfiguration = "double_end"
}
StaticData.DoubleEndCargoLoco.name = StaticData.MakeName(StaticData.DoubleEndCargoLoco)
StaticData.entityNames[StaticData.DoubleEndCargoLoco.name] = StaticData.DoubleEndCargoLoco
StaticData.DoubleEndCargoPlacement = {
collision_box = placementDetails.collision_box,
selection_box = placementDetails.selection_box,
connection_distance = placementDetails.connection_distance,
connection_snap_distance = placementDetails.connection_snap_distance,
joint_distance = placementDetails.joint_distance,
placedStaticDataWagon = StaticData.DoubleEndCargoWagon,
placedStaticDataLoco = StaticData.DoubleEndCargoLoco,
unitType = "cargo",
type = "placement",
prototypeType = "locomotive",
locoConfiguration = "double_end"
}
StaticData.DoubleEndCargoPlacement.name = StaticData.MakeName(StaticData.DoubleEndCargoPlacement)
StaticData.entityNames[StaticData.DoubleEndCargoPlacement.name] = StaticData.DoubleEndCargoPlacement
StaticData.DoubleEndCargoWagon.placementStaticData = StaticData.DoubleEndCargoPlacement
StaticData.DoubleEndCargoLoco.placementStaticData = StaticData.DoubleEndCargoPlacement
StaticData.DoubleEndFluidWagon = {
collision_box = centreWagonDetails.collision_box,
selection_box = centreWagonDetails.selection_box,
connection_distance = centreWagonDetails.connection_distance,
connection_snap_distance = centreWagonDetails.connection_snap_distance,
joint_distance = centreWagonDetails.joint_distance,
unitType = "fluid",
type = "wagon",
prototypeType = "fluid-wagon",
locoConfiguration = "double_end"
}
StaticData.DoubleEndFluidWagon.name = StaticData.MakeName(StaticData.DoubleEndFluidWagon)
StaticData.entityNames[StaticData.DoubleEndFluidWagon.name] = StaticData.DoubleEndFluidWagon
StaticData.DoubleEndFluidLoco = {
collision_box = locoDetails.collision_box,
selection_box = locoDetails.selection_box,
connection_distance = locoDetails.connection_distance,
connection_snap_distance = locoDetails.connection_snap_distance,
joint_distance = locoDetails.joint_distance,
unitType = "fluid",
type = "loco",
prototypeType = "locomotive",
locoConfiguration = "double_end"
}
StaticData.DoubleEndFluidLoco.name = StaticData.MakeName(StaticData.DoubleEndFluidLoco)
StaticData.entityNames[StaticData.DoubleEndFluidLoco.name] = StaticData.DoubleEndFluidLoco
StaticData.DoubleEndFluidPlacement = {
collision_box = placementDetails.collision_box,
selection_box = placementDetails.selection_box,
connection_distance = placementDetails.connection_distance,
connection_snap_distance = placementDetails.connection_snap_distance,
joint_distance = placementDetails.joint_distance,
placedStaticDataWagon = StaticData.DoubleEndFluidWagon,
placedStaticDataLoco = StaticData.DoubleEndFluidLoco,
unitType = "fluid",
type = "placement",
prototypeType = "locomotive",
locoConfiguration = "double_end"
}
StaticData.DoubleEndFluidPlacement.name = StaticData.MakeName(StaticData.DoubleEndFluidPlacement)
StaticData.entityNames[StaticData.DoubleEndFluidPlacement.name] = StaticData.DoubleEndFluidPlacement
StaticData.DoubleEndFluidWagon.placementStaticData = StaticData.DoubleEndFluidPlacement
StaticData.DoubleEndFluidLoco.placementStaticData = StaticData.DoubleEndFluidPlacement
return StaticData