Skip to main content
Skip to main content

InlineWrapperPushOffEvent

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

anyselfinstance of class event

Code

function InlineWrapperPushOffEvent.emptyNew()
local self = Event.new( InlineWrapperPushOffEvent _mt)
return self
end

new

Description

Create new instance of event

Definition

new(table inlineWrapper)

Arguments

tableinlineWrapperinlineWrapper

Return Values

tableinstanceinstance of event

Code

function InlineWrapperPushOffEvent.new(inlineWrapper)
local self = InlineWrapperPushOffEvent.emptyNew()
self.inlineWrapper = inlineWrapper
return self
end

readStream

Description

Called on client side on join

Definition

readStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function InlineWrapperPushOffEvent:readStream(streamId, connection)
if not connection:getIsServer() then
self.inlineWrapper = NetworkUtil.readNodeObject(streamId)
end
self:run(connection)
end

run

Description

Run action on receiving side

Definition

run(Connection connection)

Arguments

Connectionconnectionconnection

Code

function InlineWrapperPushOffEvent:run(connection)
if not connection:getIsServer() then
if self.inlineWrapper ~ = nil and self.inlineWrapper:getIsSynchronized() then
self.inlineWrapper:pushOffInlineBale()
end
end
end

writeStream

Description

Called on server side on join

Definition

writeStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function InlineWrapperPushOffEvent:writeStream(streamId, connection)
if connection:getIsServer() then
NetworkUtil.writeNodeObject(streamId, self.inlineWrapper)
end
end