DiseaseGridSnapshotRequestEvent = {}
local DiseaseGridSnapshotRequestEvent_mt = Class(DiseaseGridSnapshotRequestEvent, Event)
InitEventClass(DiseaseGridSnapshotRequestEvent, "DiseaseGridSnapshotRequestEvent")

function DiseaseGridSnapshotRequestEvent.emptyNew()
    return Event.new(DiseaseGridSnapshotRequestEvent_mt)
end

function DiseaseGridSnapshotRequestEvent.new()
    return DiseaseGridSnapshotRequestEvent.emptyNew()
end

function DiseaseGridSnapshotRequestEvent:writeStream(_, _) end

function DiseaseGridSnapshotRequestEvent:readStream(_, connection)
    self:run(connection)
end

function DiseaseGridSnapshotRequestEvent:run(connection)
    if g_server ~= nil and DiseaseCore ~= nil and DiseaseCore.sendFullStateToConnection ~= nil then
        DiseaseCore:sendFullStateToConnection(connection)
    end
end

function DiseaseGridSnapshotRequestEvent.send()
    if g_client ~= nil then
        g_client:getServerConnection():sendEvent(DiseaseGridSnapshotRequestEvent.new())
    end
end
