Script v1.4.4.0
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
BaleWrapperStateEvent
DescriptionEvent for bale wrapper stateFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
15 | function BaleWrapperStateEvent:emptyNew() |
16 | local self = Event:new(BaleWrapperStateEvent_mt); |
17 | return self; |
18 | end; |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer stateId, integer nearestBaleServerId)Arguments
table | object | object |
integer | stateId | state id |
integer | nearestBaleServerId | server id of nearest bale |
25 | function BaleWrapperStateEvent:new(object, stateId, nearestBaleServerId) |
26 | local self = BaleWrapperStateEvent:emptyNew() |
27 | self.object = object; |
28 | self.stateId = stateId; |
29 | assert(nearestBaleServerId ~= nil or self.stateId ~= BaleWrapper.CHANGE_GRAB_BALE); |
30 | self.nearestBaleServerId = nearestBaleServerId; |
31 | return self; |
32 | end; |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
38 | function BaleWrapperStateEvent:readStream(streamId, connection) |
39 | self.object = readNetworkNodeObject(streamId); |
40 | self.stateId = streamReadInt8(streamId); |
41 | if self.stateId == BaleWrapper.CHANGE_GRAB_BALE then |
42 | self.nearestBaleServerId = readNetworkNodeObjectId(streamId); |
43 | end; |
44 | self:run(connection); |
45 | end; |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
51 | function BaleWrapperStateEvent:writeStream(streamId, connection) |
52 | writeNetworkNodeObject(streamId, self.object); |
53 | streamWriteInt8(streamId, self.stateId); |
54 | if self.stateId == BaleWrapper.CHANGE_GRAB_BALE then |
55 | writeNetworkNodeObjectId(streamId, self.nearestBaleServerId); |
56 | end; |
57 | end; |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
62 | function BaleWrapperStateEvent:run(connection) |
63 | self.object:doStateChange(self.stateId, self.nearestBaleServerId); |
64 | end; |