-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathCpAIImplement.lua
More file actions
164 lines (123 loc) · 5.98 KB
/
Copy pathCpAIImplement.lua
File metadata and controls
164 lines (123 loc) · 5.98 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
--- This spec is only for overwriting giants function of the AIImplement.
local modName = CpAIImplement and CpAIImplement.MOD_NAME -- for reload
---@class CpAIImplement
CpAIImplement = {}
CpAIImplement.MOD_NAME = g_currentModName or modName
CpAIImplement.NAME = ".cpAIImplement"
CpAIImplement.SPEC_NAME = CpAIImplement.MOD_NAME .. CpAIImplement.NAME
CpAIImplement.KEY = "."..CpAIImplement.MOD_NAME..CpAIImplement.NAME
function CpAIImplement.initSpecialization()
local schema = Vehicle.xmlSchemaSavegame
local key = "vehicles.vehicle(?)" .. CpAIImplement.KEY
end
function CpAIImplement.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(AIImplement, specializations)
end
function CpAIImplement.register(typeManager,typeName,specializations)
if CpAIImplement.prerequisitesPresent(specializations) then
typeManager:addSpecialization(typeName, CpAIImplement.SPEC_NAME)
end
end
function CpAIImplement.registerEventListeners(vehicleType)
SpecializationUtil.registerEventListener(vehicleType, 'onLoad', CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementStart", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementActive", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementEnd", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementPrepareForWork", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementStartLine", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementEndLine", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementStartTurn", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementTurnProgress", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementEndTurn", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementSideOffsetChanged", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementBlock", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementContinue", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementPrepareForTransport", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementJobVehicleBlock", CpAIImplement)
SpecializationUtil.registerEventListener(vehicleType, "onAIImplementJobVehicleContinue", CpAIImplement)
end
function CpAIImplement.registerFunctions(vehicleType)
end
function CpAIImplement.registerOverwrittenFunctions(vehicleType)
end
function CpAIImplement.registerEvents(vehicleType)
end
function CpAIImplement:onLoad(savegame)
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
end
function CpAIImplement:onAIImplementStart()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementStart()")
end
function CpAIImplement:onAIImplementActive()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
-- CpUtil.info("onAIImplementActive()")
end
function CpAIImplement:onAIImplementEnd()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementEnd()")
end
function CpAIImplement:onAIImplementPrepareForWork()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementPrepareForWork()")
end
function CpAIImplement:onAIImplementStartLine()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementStartLine()")
end
function CpAIImplement:onAIImplementEndLine()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementEndLine()")
end
function CpAIImplement:onAIImplementStartTurn()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementStartTurn()")
end
function CpAIImplement:onAIImplementTurnProgress()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
-- CpUtil.info("onAIImplementTurnProgress()")
end
function CpAIImplement:onAIImplementEndTurn()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementEndTurn()")
end
function CpAIImplement:onAIImplementSideOffsetChanged()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementSideOffsetChanged()")
end
function CpAIImplement:onAIImplementBlock()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementBlock()")
end
function CpAIImplement:onAIImplementContinue()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementContinue()")
end
function CpAIImplement:onAIImplementPrepareForTransport()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementPrepareForTransport()")
end
function CpAIImplement:onAIImplementJobVehicleBlock()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementJobVehicleBlock()")
end
function CpAIImplement:onAIImplementJobVehicleContinue()
self.spec_cpAIImplement = self["spec_" .. CpAIImplement.SPEC_NAME]
local spec = self.spec_cpAIImplement
CpUtil.info("onAIImplementJobVehicleContinue()")
end