Files
blitzkit/packages/core/src/protos/tanks.ts
T
2025-03-18 17:26:09 -05:00

158 lines
4.6 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tanks.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Tank } from "./tank";
export const protobufPackage = "blitzkit";
export interface Tanks {
tanks: string[];
}
export interface TanksFull {
tanks: Tank[];
}
function createBaseTanks(): Tanks {
return { tanks: [] };
}
export const Tanks: MessageFns<Tanks> = {
encode(message: Tanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tanks {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanks();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tanks {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => globalThis.String(e)) : [] };
},
toJSON(message: Tanks): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks;
}
return obj;
},
create<I extends Exact<DeepPartial<Tanks>, I>>(base?: I): Tanks {
return Tanks.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tanks>, I>>(object: I): Tanks {
const message = createBaseTanks();
message.tanks = object.tanks?.map((e) => e) || [];
return message;
},
};
function createBaseTanksFull(): TanksFull {
return { tanks: [] };
}
export const TanksFull: MessageFns<TanksFull> = {
encode(message: TanksFull, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
Tank.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TanksFull {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanksFull();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(Tank.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TanksFull {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => Tank.fromJSON(e)) : [] };
},
toJSON(message: TanksFull): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks.map((e) => Tank.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<TanksFull>, I>>(base?: I): TanksFull {
return TanksFull.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TanksFull>, I>>(object: I): TanksFull {
const message = createBaseTanksFull();
message.tanks = object.tanks?.map((e) => Tank.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}