LUADOC - Farming Simulator 19

AbstractManager

Description
Abstract base class for Manager classes
Functions

initDataStructures

Description
Initialize data structures
Definition
initDataStructures()
Code
27function AbstractManager:initDataStructures()
28end

load

Description
Loads initial manager
Definition
load()
Return Values
booleantrueif loading was successful else false
Code
33function AbstractManager:load()
34 return true
35end

loadMapData

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

new

Description
Creating manager
Definition
new()
Return Values
tableinstanceinstance of object
Code
16function AbstractManager:new(customMt)
17 local self = setmetatable({}, customMt or AbstractManager_mt)
18
19 self:initDataStructures()
20 self.loadedMapData = false
21
22 return self
23end

unloadMapData

Description
Unload data on mission delete
Definition
unloadMapData()
Code
51function AbstractManager:unloadMapData()
52 self.loadedMapData = false
53 self:initDataStructures()
54end