LUADOC - Farming Simulator 22

Script v1_7_1_0

Engine v1_7_1_0

Foundation Reference

AbstractManager

Description
This class is an abstract template to be implemented by all map-bound manager classes
Functions

initDataStructures

Description
Initialize data structures
Definition
initDataStructures()
Code
30function AbstractManager:initDataStructures()
31end

load

Description
Loads initial manager
Definition
load()
Return Values
booleantrueif loading was successful else false
Code
36function AbstractManager:load()
37 return true
38end

loadMapData

Description
Load data on map load
Definition
loadMapData()
Return Values
booleantrueif loading was successful else false
Code
43function AbstractManager:loadMapData()
44 if g_isDevelopmentVersion and self.loadedMapData then
45 Logging.error("Manager map-data already loaded or not deleted after last game load!")
46 printCallstack()
47 end
48 self.loadedMapData = true
49 return true
50end

new

Description
Creating manager
Definition
new()
Return Values
tableinstanceinstance of object
Code
16function AbstractManager.new(customMt)
17 if customMt ~= nil and type(customMt) ~= "table" then
18 printCallstack()
19 end
20 local self = setmetatable({}, customMt or AbstractManager_mt)
21
22 self:initDataStructures()
23 self.loadedMapData = false
24
25 return self
26end

unloadMapData

Description
Unload data on mission delete
Definition
unloadMapData()
Code
54function AbstractManager:unloadMapData()
55 self.loadedMapData = false
56 self:initDataStructures()
57end