LinkBaleToWrapperEvent = {};
LinkBaleToWrapperEvent_mt = Class(LinkBaleToWrapperEvent, Event);
InitEventClass(LinkBaleToWrapperEvent, "LinkBaleToWrapperEvent");

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

function LinkBaleToWrapperEvent:new(vehicle)
    local self = LinkBaleToWrapperEvent:emptyNew();
	self.vehicle = vehicle;
    return self;
end;

function LinkBaleToWrapperEvent:writeStream(streamId, connection)
	streamWriteInt32(streamId, networkGetObjectId(self.vehicle));
end;

function LinkBaleToWrapperEvent:readStream(streamId, connection)
	self.vehicle = networkGetObject(streamReadInt32(streamId));
	self:run(connection);
end;

function LinkBaleToWrapperEvent:run(connection)
	self.vehicle:linkBaleToWrapper();
end;