achsverschiebungEvent = {};
achsverschiebungEvent_mt = Class(achsverschiebungEvent, Event);

InitEventClass(achsverschiebungEvent, "achsverschiebungEvent");

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

function achsverschiebungEvent:new(object, data)
    local self = achsverschiebungEvent:emptyNew()
    self.object = object;
	self.data = data;
    return self;
end;

function achsverschiebungEvent:readStream(streamId, connection)
    local id = streamReadInt32(streamId);
	self.object = networkGetObject(id);
	self.data = streamReadBool(streamId);
	self.object.achsverschiebungrear = self.data;
	if not connection:getIsServer() then
        g_server:broadcastEvent(achsverschiebungEvent:new(self.object, self.data), nil, connection, self.object);
    end;
end;

function achsverschiebungEvent:writeStream(streamId, connection)
    streamWriteInt32(streamId, networkGetObjectId(self.object));
	streamWriteBool(streamId, self.data);
end;

function achsverschiebungEvent.sendEvent(vehicle, data)
	if g_server ~= nil then
		g_server:broadcastEvent(achsverschiebungEvent:new(vehicle, data), nil, nil, vehicle);
	else
		g_client:getServerConnection():sendEvent(achsverschiebungEvent:new(vehicle, data));
	end;
end;

