LUADOC - Farming Simulator 22

Script v1_7_1_0

Engine v1_7_1_0

Foundation Reference

InlineWrapperPushOffEvent

Description
Event for pushing off the bales from inline wrapper
Parent
Event
Functions

emptyNew

Description
Create instance of Event class
Definition
emptyNew()
Return Values
tableselfinstance of class event
Code
13function InlineWrapperPushOffEvent.emptyNew()
14 local self = Event.new(InlineWrapperPushOffEvent_mt)
15 return self
16end

new

Description
Create new instance of event
Definition
new(table inlineWrapper)
Arguments
tableinlineWrapperinlineWrapper
Return Values
tableinstanceinstance of event
Code
22function InlineWrapperPushOffEvent.new(inlineWrapper)
23 local self = InlineWrapperPushOffEvent.emptyNew()
24 self.inlineWrapper = inlineWrapper
25 return self
26end

readStream

Description
Called on client side on join
Definition
readStream(integer streamId, integer connection)
Arguments
integerstreamIdstreamId
integerconnectionconnection
Code
32function InlineWrapperPushOffEvent:readStream(streamId, connection)
33 if not connection:getIsServer() then
34 self.inlineWrapper = NetworkUtil.readNodeObject(streamId)
35 end
36 self:run(connection)
37end

run

Description
Run action on receiving side
Definition
run(integer connection)
Arguments
integerconnectionconnection
Code
52function InlineWrapperPushOffEvent:run(connection)
53 if not connection:getIsServer() then
54 if self.inlineWrapper ~= nil and self.inlineWrapper:getIsSynchronized() then
55 self.inlineWrapper:pushOffInlineBale()
56 end
57 end
58end

writeStream

Description
Called on server side on join
Definition
writeStream(integer streamId, integer connection)
Arguments
integerstreamIdstreamId
integerconnectionconnection
Code
43function InlineWrapperPushOffEvent:writeStream(streamId, connection)
44 if connection:getIsServer() then
45 NetworkUtil.writeNodeObject(streamId, self.inlineWrapper)
46 end
47end