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
GroundTypeManager
DescriptionThis class handles the mapping of ground types (like dirt, grass, gravel) to the layers in the map's terrain.Parent
AbstractManagerFunctions
initDataStructures
DescriptionInitialize data structuresDefinition
initDataStructures()Code
23 | function GroundTypeManager:initDataStructures() |
24 | self.groundTypes = {} -- {type name = {fallbacks = {i = fallback layer name}}} |
25 | self.groundTypeMappings = {} -- {type name = layer name} |
26 | self.terrainLayerMapping = {} -- {layer name = layer ID} |
27 | end |
initTerrain
DescriptionInitialize the ground type manager with the data from the terrainDefinition
initTerrain(entity terrainRootNode)Arguments
entity | terrainRootNode | the root node of the terrain |
96 | function GroundTypeManager:initTerrain(terrainRootNode) |
97 | self.terrainLayerMapping = {} |
98 | local numLayers = getTerrainNumOfLayers(terrainRootNode) |
99 | for i = 0, numLayers - 1 do |
100 | local layerName = getTerrainLayerName(terrainRootNode, i) |
101 | self.terrainLayerMapping[layerName] = i |
102 | end |
103 | end |
loadMapData
DescriptionLoad data on map loadDefinition
loadMapData()Return Values
boolean | true | if loading was successful else false |
58 | function GroundTypeManager:loadMapData(xmlFile, missionInfo, baseDirectory) |
59 | GroundTypeManager:superClass().loadMapData(self) |
60 | self:loadGroundTypes() |
61 | return XMLUtil.loadDataFromMapXML(xmlFile, "groundTypeMappings", baseDirectory, self, self.loadGroundTypeMappings, missionInfo) |
62 | end |
new
DescriptionCreating managerDefinition
new()Return Values
table | instance | instance of object |
16 | function GroundTypeManager:new(customMt) |
17 | local self = AbstractManager:new(customMt or GroundTypeManager_mt) |
18 | return self |
19 | end |