// @generated by protobuf-ts 2.11.1
// @generated from protobuf file "event.proto" (package "aegis", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { DroneScanUpdate } from "./game";
import { GamesFooter } from "./game";
import { GameFooter } from "./game";
import { Round } from "./game";
import { GameHeader } from "./game";
import { GamesHeader } from "./game";
/**
 * @generated from protobuf message aegis.Event
 */
export interface Event {
    /**
     * @generated from protobuf oneof: event
     */
    event: {
        oneofKind: "gamesHeader";
        /**
         * @generated from protobuf field: aegis.GamesHeader games_header = 1
         */
        gamesHeader: GamesHeader;
    } | {
        oneofKind: "gameHeader";
        /**
         * @generated from protobuf field: aegis.GameHeader game_header = 2
         */
        gameHeader: GameHeader;
    } | {
        oneofKind: "round";
        /**
         * @generated from protobuf field: aegis.Round round = 3
         */
        round: Round;
    } | {
        oneofKind: "gameFooter";
        /**
         * @generated from protobuf field: aegis.GameFooter game_footer = 4
         */
        gameFooter: GameFooter;
    } | {
        oneofKind: "gamesFooter";
        /**
         * @generated from protobuf field: aegis.GamesFooter games_footer = 5
         */
        gamesFooter: GamesFooter;
    } | {
        oneofKind: "droneScanUpdate";
        /**
         * @generated from protobuf field: aegis.DroneScanUpdate drone_scan_update = 6
         */
        droneScanUpdate: DroneScanUpdate;
    } | {
        oneofKind: undefined;
    };
}
// @generated message type with reflection information, may provide speed optimized methods
class Event$Type extends MessageType<Event> {
    constructor() {
        super("aegis.Event", [
            { no: 1, name: "games_header", kind: "message", oneof: "event", T: () => GamesHeader },
            { no: 2, name: "game_header", kind: "message", oneof: "event", T: () => GameHeader },
            { no: 3, name: "round", kind: "message", oneof: "event", T: () => Round },
            { no: 4, name: "game_footer", kind: "message", oneof: "event", T: () => GameFooter },
            { no: 5, name: "games_footer", kind: "message", oneof: "event", T: () => GamesFooter },
            { no: 6, name: "drone_scan_update", kind: "message", oneof: "event", T: () => DroneScanUpdate }
        ]);
    }
    create(value?: PartialMessage<Event>): Event {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.event = { oneofKind: undefined };
        if (value !== undefined)
            reflectionMergePartial<Event>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Event): Event {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* aegis.GamesHeader games_header */ 1:
                    message.event = {
                        oneofKind: "gamesHeader",
                        gamesHeader: GamesHeader.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).gamesHeader)
                    };
                    break;
                case /* aegis.GameHeader game_header */ 2:
                    message.event = {
                        oneofKind: "gameHeader",
                        gameHeader: GameHeader.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).gameHeader)
                    };
                    break;
                case /* aegis.Round round */ 3:
                    message.event = {
                        oneofKind: "round",
                        round: Round.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).round)
                    };
                    break;
                case /* aegis.GameFooter game_footer */ 4:
                    message.event = {
                        oneofKind: "gameFooter",
                        gameFooter: GameFooter.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).gameFooter)
                    };
                    break;
                case /* aegis.GamesFooter games_footer */ 5:
                    message.event = {
                        oneofKind: "gamesFooter",
                        gamesFooter: GamesFooter.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).gamesFooter)
                    };
                    break;
                case /* aegis.DroneScanUpdate drone_scan_update */ 6:
                    message.event = {
                        oneofKind: "droneScanUpdate",
                        droneScanUpdate: DroneScanUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).droneScanUpdate)
                    };
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: Event, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* aegis.GamesHeader games_header = 1; */
        if (message.event.oneofKind === "gamesHeader")
            GamesHeader.internalBinaryWrite(message.event.gamesHeader, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* aegis.GameHeader game_header = 2; */
        if (message.event.oneofKind === "gameHeader")
            GameHeader.internalBinaryWrite(message.event.gameHeader, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* aegis.Round round = 3; */
        if (message.event.oneofKind === "round")
            Round.internalBinaryWrite(message.event.round, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* aegis.GameFooter game_footer = 4; */
        if (message.event.oneofKind === "gameFooter")
            GameFooter.internalBinaryWrite(message.event.gameFooter, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* aegis.GamesFooter games_footer = 5; */
        if (message.event.oneofKind === "gamesFooter")
            GamesFooter.internalBinaryWrite(message.event.gamesFooter, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* aegis.DroneScanUpdate drone_scan_update = 6; */
        if (message.event.oneofKind === "droneScanUpdate")
            DroneScanUpdate.internalBinaryWrite(message.event.droneScanUpdate, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message aegis.Event
 */
export const Event = new Event$Type();
