Skip to main content
Skip to main content

AIAutomaticSteeringLineEndEvent

AIAutomaticSteeringLineEndEvent

Description

Event when hitting the end of the line (server to client)

Parent

Event

Functions

emptyNew

Description

Create instance of Event class

Definition

emptyNew()

Return Values

anyselfinstance of class event

Code

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

new

Description

Create new instance of event

Definition

new(table vehicle, integer currentAngle, , )

Arguments

tablevehiclevehicle
integercurrentAnglecurrent angle
anysegmentIndex
anysegmentIsLeft

Code

function AIAutomaticSteeringLineEndEvent.new(vehicle, state, segmentIndex, segmentIsLeft)
local self = AIAutomaticSteeringLineEndEvent.emptyNew()
self.vehicle = vehicle

return self
end

readStream

Description

Called on client side on join

Definition

readStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function AIAutomaticSteeringLineEndEvent:readStream(streamId, connection)
self.vehicle = NetworkUtil.readNodeObject(streamId)
self:run(connection)
end

run

Description

Run action on receiving side

Definition

run(Connection connection)

Arguments

Connectionconnectionconnection

Code

function AIAutomaticSteeringLineEndEvent:run(connection)
if self.vehicle ~ = nil and self.vehicle:getIsSynchronized() then
SpecializationUtil.raiseEvent( self.vehicle, "onAIAutomaticSteeringLineEnd" )
end
end

writeStream

Description

Called on server side on join

Definition

writeStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function AIAutomaticSteeringLineEndEvent:writeStream(streamId, connection)
NetworkUtil.writeNodeObject(streamId, self.vehicle)
end