-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathStopFillingEvent.lua
39 lines (34 loc) · 1.01 KB
/
StopFillingEvent.lua
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
StopFillingEvent = {}
StopFillingEvent_mt = Class(StopFillingEvent, Event)
InitEventClass(StopFillingEvent, "StopFillingEvent")
function StopFillingEvent.emptyNew()
local self = Event.new(StopFillingEvent_mt)
return self
end
function StopFillingEvent.new(object)
local self = StopFillingEvent.emptyNew()
self.object = object
return self
end
function StopFillingEvent:readStream(streamId, connection)
if not connection:getIsServer() then
self.object = NetworkUtil.readNodeObject(streamId)
self.object.spec_bulkFill.isFilling = false
self.object.spec_fillUnit.fillTrigger.currentTrigger = nil
end
self:run(connection)
end
function StopFillingEvent:writeStream(streamId, connection)
if connection:getIsServer() then
NetworkUtil.writeNodeObject(streamId, self.object)
end
end
function StopFillingEvent:run(connection)
if not connection:getIsServer() then
--print("StopFillingEvent: server")
self.object:stopFilling(true)
else
--print("StopFillingEvent: client")
--self.object:stopFilling(true)
end
end