Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- AbstractManager
- AsyncManager
- AutoSaveManager
- BaleTypeManager
- BrandColorManager
- ConnectionHoseManager
- DeferredLoadingManager
- DepthOfFieldManager
- FillTypeManager
- FruitTypeManager
- GameplayHintManager
- GroundTypeManager
- HelpLineManager
- MapManager
- PlaceableTypeManager
- SleepManager
- SplitTypeManager
- SprayTypeManager
- TensionBeltManager
- ToolTypeManager
- TreePlantManager
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
PlaceableTypeManager
DescriptionThis class handles all placeable typesParent
AbstractManagerFunctions
initDataStructures
DescriptionInitialize data structuresDefinition
initDataStructures()Code
24 | function PlaceableTypeManager:initDataStructures() |
25 | self.placeableTypes = {} |
26 | end |
loadMapData
DescriptionLoad data on map loadDefinition
loadMapData()Return Values
boolean | true | if loading was successful else false |
31 | function PlaceableTypeManager:loadMapData() |
32 | PlaceableTypeManager:superClass().loadMapData(self) |
33 | |
34 | local xmlFile = loadXMLFile("PlaceableTypesXML", "dataS/placeableTypes.xml") |
35 | local i=0 |
36 | while true do |
37 | local baseName = string.format("placeableTypes.placeableType(%d)", i) |
38 | |
39 | local typeName = getXMLString(xmlFile, baseName.. "#name") |
40 | if typeName == nil then |
41 | break |
42 | end |
43 | local className = getXMLString(xmlFile, baseName.. "#className") |
44 | local filename = getXMLString(xmlFile, baseName.. "#filename") |
45 | |
46 | self:addPlaceableType(typeName, className, filename, "") |
47 | i = i+1 |
48 | end |
49 | delete(xmlFile) |
50 | |
51 | print(" Loaded placeable types") |
52 | |
53 | return true |
54 | end |
new
DescriptionCreating managerDefinition
new()Return Values
table | instance | instance of object |
16 | function PlaceableTypeManager:new(customMt) |
17 | local self = AbstractManager:new(customMt or PlaceableTypeManager_mt) |
18 | |
19 | return self |
20 | end |