Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- AnimatedMapObject
- AnimatedObject
- AnimatedObjectEvent
- Bale
- Basketball
- Bga
- BgaSellStation
- BunkerSilo
- BuyingStation
- DigitalDisplay
- DogBall
- HelpIcons
- LoadingStation
- NightIllumination
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SellingStation
- SimParticleSystem
- Storage
- StorageSystem
- SunAdmirer
- TourIcons
- UnloadingStation
- VehicleSellingPoint
- WildlifeSpawner
- 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
SellingStation
ParentUnloadingStationFunctions
loadFromXMLFile
DescriptionLoading from attributes and nodesDefinition
loadFromXMLFile(integer xmlFile, string key)Arguments
integer | xmlFile | id of xml object |
string | key | key |
boolean | success | success |
229 | function SellingStation:loadFromXMLFile(xmlFile, key) |
230 | local i=0 |
231 | while true do |
232 | local statsKey = string.format(key..".stats(%d)", i) |
233 | if not hasXMLProperty(xmlFile, statsKey) then |
234 | break |
235 | end |
236 | local fillTypeStr = getXMLString(xmlFile, statsKey.."#fillType") |
237 | local fillType = g_fillTypeManager:getFillTypeIndexByName(fillTypeStr) |
238 | if fillType ~= nil and self.acceptedFillTypes[fillType] then |
239 | self.totalReceived[fillType] = Utils.getNoNil(getXMLFloat(xmlFile, statsKey.."#received"), 0) |
240 | self.totalPaid[fillType] = Utils.getNoNil(getXMLFloat(xmlFile, statsKey.."#paid"), 0) |
241 | self.pricingDynamics[fillType]:loadFromXMLFile(xmlFile, statsKey) |
242 | end |
243 | i = i + 1 |
244 | end |
245 | |
246 | return true |
247 | end |