Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- AnimalLoadingTrigger
- BasketTrigger
- FillPlane
- FillTrigger
- InsideBuildingTrigger
- LoadTrigger
- LoadTriggerSetIsLoadingEv...
- LoanTrigger
- RainDropFactorTrigger
- ShopTrigger
- TransportMissionTrigger
- UnloadFeedingTrough
- UnloadTrigger
- WeighStation
- 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
LoadTriggerSetIsLoadingEvent
DescriptionCopyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.Functions
emptyNew
DescriptionDefinitionemptyNew()Code
13 | function LoadTriggerSetIsLoadingEvent:emptyNew() |
14 | local self = Event:new(loadTriggerSetIsLoadingEvent_mt) |
15 | return self |
16 | end |
new
DescriptionDefinitionnew()Code
20 | function LoadTriggerSetIsLoadingEvent:new(object, isLoading, targetObject, fillUnitIndex, fillType) |
21 | local self = LoadTriggerSetIsLoadingEvent:emptyNew() |
22 | self.object = object |
23 | self.isLoading = isLoading |
24 | self.targetObject = targetObject |
25 | self.fillUnitIndex = fillUnitIndex |
26 | self.fillType = fillType |
27 | return self |
28 | end |
readStream
DescriptionDefinitionreadStream()Code
32 | function LoadTriggerSetIsLoadingEvent:readStream(streamId, connection) |
33 | self.object = NetworkUtil.readNodeObject(streamId) |
34 | self.isLoading = streamReadBool(streamId) |
35 | if self.isLoading then |
36 | self.targetObject = NetworkUtil.readNodeObject(streamId) |
37 | self.fillUnitIndex = streamReadUInt8(streamId) |
38 | self.fillType = streamReadUIntN(streamId, FillTypeManager.SEND_NUM_BITS) |
39 | end |
40 | |
41 | self:run(connection) |
42 | end |
run
DescriptionDefinitionrun()Code
57 | function LoadTriggerSetIsLoadingEvent:run(connection) |
58 | self.object:setIsLoading(self.isLoading, self.targetObject, self.fillUnitIndex, self.fillType, true) |
59 | |
60 | if not connection:getIsServer() then |
61 | g_server:broadcastEvent(LoadTriggerSetIsLoadingEvent:new(self.object, self.isLoading, self.targetObject, self.fillUnitIndex, self.fillType), nil, connection, self.object) |
62 | end |
63 | end |
sendEvent
DescriptionDefinitionsendEvent()Code
67 | function LoadTriggerSetIsLoadingEvent.sendEvent(object, isLoading, targetObject, fillUnitIndex, fillType, noEventSend) |
68 | if isLoading ~= object.isLoading then |
69 | if noEventSend == nil or noEventSend == false then |
70 | if g_server ~= nil then |
71 | g_server:broadcastEvent(LoadTriggerSetIsLoadingEvent:new(object, isLoading, targetObject, fillUnitIndex, fillType), nil, nil, object) |
72 | else |
73 | g_client:getServerConnection():sendEvent(LoadTriggerSetIsLoadingEvent:new(object, isLoading, targetObject, fillUnitIndex, fillType)) |
74 | end |
75 | end |
76 | end |
77 | end |
writeStream
DescriptionDefinitionwriteStream()Code
46 | function LoadTriggerSetIsLoadingEvent:writeStream(streamId, connection) |
47 | NetworkUtil.writeNodeObject(streamId, self.object) |
48 | if streamWriteBool(streamId, self.isLoading) then |
49 | NetworkUtil.writeNodeObject(streamId, self.targetObject) |
50 | streamWriteUInt8(streamId, self.fillUnitIndex) |
51 | streamWriteUIntN(streamId, self.fillType, FillTypeManager.SEND_NUM_BITS) |
52 | end |
53 | end |