-- author: rafftnix
-- date: 16.12.2012


SetSawContactTimerEvent = {};
SetSawContactTimerEvent_mt = Class(SetSawContactTimerEvent, Event);
InitEventClass(SetSawContactTimerEvent, "SetSawContactTimerEvent");

function SetSawContactTimerEvent:emptyNew()
    local self = Event:new(SetSawContactTimerEvent_mt);
    self.className="SetSawContactTimerEvent";
    return self;
end;

function SetSawContactTimerEvent:new(object, val, val2)
    local self = SetSawContactTimerEvent:emptyNew(); 
    self.object = object; 
	self.val = val;
	self.val2 = val2;
    return self;
end;

function SetSawContactTimerEvent:writeStream(streamId, connection)
    streamWriteInt32(streamId, networkGetObjectId(self.object));
    streamWriteInt16(streamId, math.floor(self.val/100));
    streamWriteInt16(streamId, math.floor(self.val2/100));
end;

function SetSawContactTimerEvent:readStream(streamId, connection)
    self.object = networkGetObject(streamReadInt32(streamId));
	self.object.saw.treeContactTimer = streamReadInt16(streamId)*100;
	self.object.saw.treeContactTimerMax = streamReadInt16(streamId)*100;
end;