forked from Dukefarming/FS25-lua-scripting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicleSetIsReconfiguratingEvent.lua
More file actions
46 lines (31 loc) · 1.2 KB
/
VehicleSetIsReconfiguratingEvent.lua
File metadata and controls
46 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---Event for set isRegonfigurating on vehicles
local VehicleSetIsReconfiguratingEvent_mt = Class(VehicleSetIsReconfiguratingEvent, Event)
---Create instance of Event class
-- @return table self instance of class event
function VehicleSetIsReconfiguratingEvent.emptyNew()
local self = Event.new(VehicleSetIsReconfiguratingEvent_mt)
return self
end
---Create new instance of event
-- @param table object object
-- @param integer state state
function VehicleSetIsReconfiguratingEvent.new(object)
local self = VehicleSetIsReconfiguratingEvent.emptyNew()
self.object = object
return self
end
---Called on client side on join
-- @param integer streamId streamId
-- @param integer connection connection
function VehicleSetIsReconfiguratingEvent:readStream(streamId, connection)
self.object = NetworkUtil.readNodeObject(streamId)
if self.object ~= nil and self.object:getIsSynchronized() then
self.object.isReconfigurating = true
end
end
---Called on server side on join
-- @param integer streamId streamId
-- @param integer connection connection
function VehicleSetIsReconfiguratingEvent:writeStream(streamId, connection)
NetworkUtil.writeNodeObject(streamId, self.object)
end