// @generated by protobuf-ts 2.11.1
// @generated from protobuf file "world_object.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";
/**
 * @generated from protobuf message aegis.Survivor
 */
export interface Survivor {
    /**
     * @generated from protobuf field: int32 id = 1
     */
    id: number;
    /**
     * @generated from protobuf field: int32 health = 2
     */
    health: number;
    /**
     * @generated from protobuf field: aegis.SurvivorState state = 3
     */
    state: SurvivorState;
}
/**
 * @generated from protobuf message aegis.Rubble
 */
export interface Rubble {
    /**
     * @generated from protobuf field: int32 id = 1
     */
    id: number;
    /**
     * @generated from protobuf field: int32 energy_required = 2
     */
    energyRequired: number;
    /**
     * @generated from protobuf field: int32 agents_required = 3
     */
    agentsRequired: number;
}
/**
 * @generated from protobuf message aegis.WorldObject
 */
export interface WorldObject {
    /**
     * @generated from protobuf oneof: object
     */
    object: {
        oneofKind: "survivor";
        /**
         * @generated from protobuf field: aegis.Survivor survivor = 1
         */
        survivor: Survivor;
    } | {
        oneofKind: "rubble";
        /**
         * @generated from protobuf field: aegis.Rubble rubble = 2
         */
        rubble: Rubble;
    } | {
        oneofKind: undefined;
    };
}
/**
 * @generated from protobuf enum aegis.SurvivorState
 */
export enum SurvivorState {
    /**
     * @generated from protobuf enum value: ALIVE = 0;
     */
    ALIVE = 0,
    /**
     * @generated from protobuf enum value: DEAD = 1;
     */
    DEAD = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class Survivor$Type extends MessageType<Survivor> {
    constructor() {
        super("aegis.Survivor", [
            { no: 1, name: "id", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 2, name: "health", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 3, name: "state", kind: "enum", T: () => ["aegis.SurvivorState", SurvivorState] }
        ]);
    }
    create(value?: PartialMessage<Survivor>): Survivor {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.id = 0;
        message.health = 0;
        message.state = 0;
        if (value !== undefined)
            reflectionMergePartial<Survivor>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Survivor): Survivor {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* int32 id */ 1:
                    message.id = reader.int32();
                    break;
                case /* int32 health */ 2:
                    message.health = reader.int32();
                    break;
                case /* aegis.SurvivorState state */ 3:
                    message.state = reader.int32();
                    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: Survivor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* int32 id = 1; */
        if (message.id !== 0)
            writer.tag(1, WireType.Varint).int32(message.id);
        /* int32 health = 2; */
        if (message.health !== 0)
            writer.tag(2, WireType.Varint).int32(message.health);
        /* aegis.SurvivorState state = 3; */
        if (message.state !== 0)
            writer.tag(3, WireType.Varint).int32(message.state);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message aegis.Survivor
 */
export const Survivor = new Survivor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Rubble$Type extends MessageType<Rubble> {
    constructor() {
        super("aegis.Rubble", [
            { no: 1, name: "id", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 2, name: "energy_required", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 3, name: "agents_required", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
        ]);
    }
    create(value?: PartialMessage<Rubble>): Rubble {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.id = 0;
        message.energyRequired = 0;
        message.agentsRequired = 0;
        if (value !== undefined)
            reflectionMergePartial<Rubble>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Rubble): Rubble {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* int32 id */ 1:
                    message.id = reader.int32();
                    break;
                case /* int32 energy_required */ 2:
                    message.energyRequired = reader.int32();
                    break;
                case /* int32 agents_required */ 3:
                    message.agentsRequired = reader.int32();
                    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: Rubble, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* int32 id = 1; */
        if (message.id !== 0)
            writer.tag(1, WireType.Varint).int32(message.id);
        /* int32 energy_required = 2; */
        if (message.energyRequired !== 0)
            writer.tag(2, WireType.Varint).int32(message.energyRequired);
        /* int32 agents_required = 3; */
        if (message.agentsRequired !== 0)
            writer.tag(3, WireType.Varint).int32(message.agentsRequired);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message aegis.Rubble
 */
export const Rubble = new Rubble$Type();
// @generated message type with reflection information, may provide speed optimized methods
class WorldObject$Type extends MessageType<WorldObject> {
    constructor() {
        super("aegis.WorldObject", [
            { no: 1, name: "survivor", kind: "message", oneof: "object", T: () => Survivor },
            { no: 2, name: "rubble", kind: "message", oneof: "object", T: () => Rubble }
        ]);
    }
    create(value?: PartialMessage<WorldObject>): WorldObject {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.object = { oneofKind: undefined };
        if (value !== undefined)
            reflectionMergePartial<WorldObject>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WorldObject): WorldObject {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* aegis.Survivor survivor */ 1:
                    message.object = {
                        oneofKind: "survivor",
                        survivor: Survivor.internalBinaryRead(reader, reader.uint32(), options, (message.object as any).survivor)
                    };
                    break;
                case /* aegis.Rubble rubble */ 2:
                    message.object = {
                        oneofKind: "rubble",
                        rubble: Rubble.internalBinaryRead(reader, reader.uint32(), options, (message.object as any).rubble)
                    };
                    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: WorldObject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* aegis.Survivor survivor = 1; */
        if (message.object.oneofKind === "survivor")
            Survivor.internalBinaryWrite(message.object.survivor, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* aegis.Rubble rubble = 2; */
        if (message.object.oneofKind === "rubble")
            Rubble.internalBinaryWrite(message.object.rubble, writer.tag(2, 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.WorldObject
 */
export const WorldObject = new WorldObject$Type();
