mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
move protos
This commit is contained in:
1 parent
5b4ad95a14
commit
054f33a649
47 files changed
+52
-11846
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { ShellDefinition, ShellType } from "../protos";
|
||||
import { ShellDefinition, ShellType } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function canSplash(
|
||||
type: ShellDefinition["type"],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GunDefinition, ProvisionDefinitions, TankDefinition } from "../protos";
|
||||
import { GunDefinition, ProvisionDefinitions, TankDefinition } from "../../../protos/src/blitzkit";
|
||||
import { checkConsumableProvisionInclusivity } from "./checkConsumableProvisionInclusivity";
|
||||
|
||||
export function availableProvisions(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { emptyAllStats } from '../../blitz/constants';
|
||||
import { Samples } from '../../protos';
|
||||
import { Samples } from '../../../../protos/src/blitzkit';
|
||||
import type { BlitzkitStats } from '../../statistics';
|
||||
|
||||
export const emptyAverageDefinitionsAllStats: BlitzkitStats = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
import { fetchPB } from "../../protobuf";
|
||||
import { AverageDefinitions } from "../../protos";
|
||||
import { AverageDefinitions } from "../../../../protos/src/blitzkit";
|
||||
|
||||
export interface AverageDefinitionsManifest {
|
||||
version: 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ShellDefinition, ShellType } from "../protos";
|
||||
import { ShellDefinition, ShellType } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function isExplosive(
|
||||
type: ShellDefinition["type"],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BoundingBox, Vector3 } from "../protos";
|
||||
import { BoundingBox, Vector3 } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function normalizeBoundingBox(boundingBox: BoundingBox) {
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
import { fetchPB } from "../protobuf";
|
||||
import { PopularTanks } from "../protos";
|
||||
import { PopularTanks } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function fetchPopularTanks() {
|
||||
return fetchPB(staticAsset("definitions/popular-tanks.pb"), PopularTanks);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { staticAsset } from "@blitzkit/core";
|
||||
import { fetchPB } from "../protobuf";
|
||||
import { Reviews } from "../protos";
|
||||
import { Reviews } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function fetchReviews() {
|
||||
return fetchPB(staticAsset("definitions/reviews.pb"), Reviews);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BoundingBox } from "../protos";
|
||||
import { BoundingBox } from "../../../protos/src/blitzkit";
|
||||
|
||||
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { forEachRight } from 'lodash-es';
|
||||
import { GunDefinition, TurretDefinition } from '../protos';
|
||||
import { GunDefinition, TurretDefinition } from '../../../protos/src/blitzkit';
|
||||
|
||||
export function uniqueGuns(turrets: TurretDefinition[]) {
|
||||
const gunIds = new Set<number>();
|
||||
|
||||
@@ -4,7 +4,7 @@ export * from "./imgur";
|
||||
export * from "./math";
|
||||
export * from "./patreon";
|
||||
export * from "./protobuf";
|
||||
export * from "./protos";
|
||||
export * from "../../protos/src/blitzkit";
|
||||
export * from "./statistics";
|
||||
export * from "./streams";
|
||||
export * from "./types";
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MessageFns } from '../protos';
|
||||
import type { MessageFns } from '../../../protos/src/blitzkit';
|
||||
|
||||
export async function fetchPB<Type>(url: string, message: MessageFns<Type>) {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,964 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: average_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface AverageDefinitions {
|
||||
averages: { [key: number]: AverageDefinitionsEntry };
|
||||
samples: Samples | undefined;
|
||||
time: number;
|
||||
}
|
||||
|
||||
export interface AverageDefinitions_AveragesEntry {
|
||||
key: number;
|
||||
value: AverageDefinitionsEntry | undefined;
|
||||
}
|
||||
|
||||
export interface AverageDefinitionsEntry {
|
||||
mu: AverageDefinitionsAllStats | undefined;
|
||||
sigma: AverageDefinitionsAllStats | undefined;
|
||||
r: AverageDefinitionsAllStats | undefined;
|
||||
samples: Samples | undefined;
|
||||
}
|
||||
|
||||
export interface AverageDefinitionsAllStats {
|
||||
battles: number;
|
||||
capture_points: number;
|
||||
damage_dealt: number;
|
||||
damage_received: number;
|
||||
dropped_capture_points: number;
|
||||
frags: number;
|
||||
frags8p: number;
|
||||
hits: number;
|
||||
losses: number;
|
||||
max_frags: number;
|
||||
max_xp: number;
|
||||
shots: number;
|
||||
spotted: number;
|
||||
survived_battles: number;
|
||||
win_and_survived: number;
|
||||
wins: number;
|
||||
xp: number;
|
||||
battle_life_time: number;
|
||||
}
|
||||
|
||||
export interface Samples {
|
||||
d_1: number;
|
||||
d_7: number;
|
||||
d_30: number;
|
||||
d_60: number;
|
||||
d_90: number;
|
||||
d_120: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
function createBaseAverageDefinitions(): AverageDefinitions {
|
||||
return { averages: {}, samples: undefined, time: 0 };
|
||||
}
|
||||
|
||||
export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
||||
encode(message: AverageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.averages).forEach(([key, value]: [string, AverageDefinitionsEntry]) => {
|
||||
AverageDefinitions_AveragesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
if (message.samples !== undefined) {
|
||||
Samples.encode(message.samples, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.time !== 0) {
|
||||
writer.uint32(24).uint64(message.time);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAverageDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = AverageDefinitions_AveragesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.averages[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.samples = Samples.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.time = longToNumber(reader.uint64());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AverageDefinitions {
|
||||
return {
|
||||
averages: isObject(object.averages)
|
||||
? (globalThis.Object.entries(object.averages) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
||||
time: isSet(object.time) ? globalThis.Number(object.time) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AverageDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.averages) {
|
||||
const entries = globalThis.Object.entries(message.averages) as [string, AverageDefinitionsEntry][];
|
||||
if (entries.length > 0) {
|
||||
obj.averages = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.averages[k] = AverageDefinitionsEntry.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (message.samples !== undefined) {
|
||||
obj.samples = Samples.toJSON(message.samples);
|
||||
}
|
||||
if (message.time !== 0) {
|
||||
obj.time = Math.round(message.time);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<AverageDefinitions>, I>>(base?: I): AverageDefinitions {
|
||||
return AverageDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitions>, I>>(object: I): AverageDefinitions {
|
||||
const message = createBaseAverageDefinitions();
|
||||
message.averages = (globalThis.Object.entries(object.averages ?? {}) as [string, AverageDefinitionsEntry][]).reduce(
|
||||
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, AverageDefinitionsEntry]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
message.samples = (object.samples !== undefined && object.samples !== null)
|
||||
? Samples.fromPartial(object.samples)
|
||||
: undefined;
|
||||
message.time = object.time ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAverageDefinitions_AveragesEntry(): AverageDefinitions_AveragesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_AveragesEntry> = {
|
||||
encode(message: AverageDefinitions_AveragesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
AverageDefinitionsEntry.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions_AveragesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAverageDefinitions_AveragesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = AverageDefinitionsEntry.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AverageDefinitions_AveragesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? AverageDefinitionsEntry.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AverageDefinitions_AveragesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = AverageDefinitionsEntry.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<AverageDefinitions_AveragesEntry>, I>>(
|
||||
base?: I,
|
||||
): AverageDefinitions_AveragesEntry {
|
||||
return AverageDefinitions_AveragesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitions_AveragesEntry>, I>>(
|
||||
object: I,
|
||||
): AverageDefinitions_AveragesEntry {
|
||||
const message = createBaseAverageDefinitions_AveragesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? AverageDefinitionsEntry.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAverageDefinitionsEntry(): AverageDefinitionsEntry {
|
||||
return { mu: undefined, sigma: undefined, r: undefined, samples: undefined };
|
||||
}
|
||||
|
||||
export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
||||
encode(message: AverageDefinitionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.mu !== undefined) {
|
||||
AverageDefinitionsAllStats.encode(message.mu, writer.uint32(10).fork()).join();
|
||||
}
|
||||
if (message.sigma !== undefined) {
|
||||
AverageDefinitionsAllStats.encode(message.sigma, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.r !== undefined) {
|
||||
AverageDefinitionsAllStats.encode(message.r, writer.uint32(26).fork()).join();
|
||||
}
|
||||
if (message.samples !== undefined) {
|
||||
Samples.encode(message.samples, writer.uint32(34).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAverageDefinitionsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.mu = AverageDefinitionsAllStats.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.sigma = AverageDefinitionsAllStats.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.r = AverageDefinitionsAllStats.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.samples = Samples.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AverageDefinitionsEntry {
|
||||
return {
|
||||
mu: isSet(object.mu) ? AverageDefinitionsAllStats.fromJSON(object.mu) : undefined,
|
||||
sigma: isSet(object.sigma) ? AverageDefinitionsAllStats.fromJSON(object.sigma) : undefined,
|
||||
r: isSet(object.r) ? AverageDefinitionsAllStats.fromJSON(object.r) : undefined,
|
||||
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AverageDefinitionsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.mu !== undefined) {
|
||||
obj.mu = AverageDefinitionsAllStats.toJSON(message.mu);
|
||||
}
|
||||
if (message.sigma !== undefined) {
|
||||
obj.sigma = AverageDefinitionsAllStats.toJSON(message.sigma);
|
||||
}
|
||||
if (message.r !== undefined) {
|
||||
obj.r = AverageDefinitionsAllStats.toJSON(message.r);
|
||||
}
|
||||
if (message.samples !== undefined) {
|
||||
obj.samples = Samples.toJSON(message.samples);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<AverageDefinitionsEntry>, I>>(base?: I): AverageDefinitionsEntry {
|
||||
return AverageDefinitionsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitionsEntry>, I>>(object: I): AverageDefinitionsEntry {
|
||||
const message = createBaseAverageDefinitionsEntry();
|
||||
message.mu = (object.mu !== undefined && object.mu !== null)
|
||||
? AverageDefinitionsAllStats.fromPartial(object.mu)
|
||||
: undefined;
|
||||
message.sigma = (object.sigma !== undefined && object.sigma !== null)
|
||||
? AverageDefinitionsAllStats.fromPartial(object.sigma)
|
||||
: undefined;
|
||||
message.r = (object.r !== undefined && object.r !== null)
|
||||
? AverageDefinitionsAllStats.fromPartial(object.r)
|
||||
: undefined;
|
||||
message.samples = (object.samples !== undefined && object.samples !== null)
|
||||
? Samples.fromPartial(object.samples)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAverageDefinitionsAllStats(): AverageDefinitionsAllStats {
|
||||
return {
|
||||
battles: 0,
|
||||
capture_points: 0,
|
||||
damage_dealt: 0,
|
||||
damage_received: 0,
|
||||
dropped_capture_points: 0,
|
||||
frags: 0,
|
||||
frags8p: 0,
|
||||
hits: 0,
|
||||
losses: 0,
|
||||
max_frags: 0,
|
||||
max_xp: 0,
|
||||
shots: 0,
|
||||
spotted: 0,
|
||||
survived_battles: 0,
|
||||
win_and_survived: 0,
|
||||
wins: 0,
|
||||
xp: 0,
|
||||
battle_life_time: 0,
|
||||
};
|
||||
}
|
||||
|
||||
export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats> = {
|
||||
encode(message: AverageDefinitionsAllStats, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.battles !== 0) {
|
||||
writer.uint32(13).float(message.battles);
|
||||
}
|
||||
if (message.capture_points !== 0) {
|
||||
writer.uint32(21).float(message.capture_points);
|
||||
}
|
||||
if (message.damage_dealt !== 0) {
|
||||
writer.uint32(29).float(message.damage_dealt);
|
||||
}
|
||||
if (message.damage_received !== 0) {
|
||||
writer.uint32(37).float(message.damage_received);
|
||||
}
|
||||
if (message.dropped_capture_points !== 0) {
|
||||
writer.uint32(45).float(message.dropped_capture_points);
|
||||
}
|
||||
if (message.frags !== 0) {
|
||||
writer.uint32(53).float(message.frags);
|
||||
}
|
||||
if (message.frags8p !== 0) {
|
||||
writer.uint32(61).float(message.frags8p);
|
||||
}
|
||||
if (message.hits !== 0) {
|
||||
writer.uint32(69).float(message.hits);
|
||||
}
|
||||
if (message.losses !== 0) {
|
||||
writer.uint32(77).float(message.losses);
|
||||
}
|
||||
if (message.max_frags !== 0) {
|
||||
writer.uint32(85).float(message.max_frags);
|
||||
}
|
||||
if (message.max_xp !== 0) {
|
||||
writer.uint32(93).float(message.max_xp);
|
||||
}
|
||||
if (message.shots !== 0) {
|
||||
writer.uint32(101).float(message.shots);
|
||||
}
|
||||
if (message.spotted !== 0) {
|
||||
writer.uint32(109).float(message.spotted);
|
||||
}
|
||||
if (message.survived_battles !== 0) {
|
||||
writer.uint32(117).float(message.survived_battles);
|
||||
}
|
||||
if (message.win_and_survived !== 0) {
|
||||
writer.uint32(125).float(message.win_and_survived);
|
||||
}
|
||||
if (message.wins !== 0) {
|
||||
writer.uint32(133).float(message.wins);
|
||||
}
|
||||
if (message.xp !== 0) {
|
||||
writer.uint32(141).float(message.xp);
|
||||
}
|
||||
if (message.battle_life_time !== 0) {
|
||||
writer.uint32(149).float(message.battle_life_time);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsAllStats {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAverageDefinitionsAllStats();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 13) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.battles = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 21) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.capture_points = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 29) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.damage_dealt = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 37) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.damage_received = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 45) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.dropped_capture_points = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 53) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.frags = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 61) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.frags8p = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 8: {
|
||||
if (tag !== 69) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.hits = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 9: {
|
||||
if (tag !== 77) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.losses = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 10: {
|
||||
if (tag !== 85) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.max_frags = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 11: {
|
||||
if (tag !== 93) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.max_xp = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 12: {
|
||||
if (tag !== 101) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shots = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 13: {
|
||||
if (tag !== 109) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.spotted = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 14: {
|
||||
if (tag !== 117) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.survived_battles = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 15: {
|
||||
if (tag !== 125) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.win_and_survived = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 16: {
|
||||
if (tag !== 133) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.wins = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 17: {
|
||||
if (tag !== 141) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.xp = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 18: {
|
||||
if (tag !== 149) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.battle_life_time = reader.float();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AverageDefinitionsAllStats {
|
||||
return {
|
||||
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
||||
capture_points: isSet(object.capturePoints)
|
||||
? globalThis.Number(object.capturePoints)
|
||||
: isSet(object.capture_points)
|
||||
? globalThis.Number(object.capture_points)
|
||||
: 0,
|
||||
damage_dealt: isSet(object.damageDealt)
|
||||
? globalThis.Number(object.damageDealt)
|
||||
: isSet(object.damage_dealt)
|
||||
? globalThis.Number(object.damage_dealt)
|
||||
: 0,
|
||||
damage_received: isSet(object.damageReceived)
|
||||
? globalThis.Number(object.damageReceived)
|
||||
: isSet(object.damage_received)
|
||||
? globalThis.Number(object.damage_received)
|
||||
: 0,
|
||||
dropped_capture_points: isSet(object.droppedCapturePoints)
|
||||
? globalThis.Number(object.droppedCapturePoints)
|
||||
: isSet(object.dropped_capture_points)
|
||||
? globalThis.Number(object.dropped_capture_points)
|
||||
: 0,
|
||||
frags: isSet(object.frags) ? globalThis.Number(object.frags) : 0,
|
||||
frags8p: isSet(object.frags8p) ? globalThis.Number(object.frags8p) : 0,
|
||||
hits: isSet(object.hits) ? globalThis.Number(object.hits) : 0,
|
||||
losses: isSet(object.losses) ? globalThis.Number(object.losses) : 0,
|
||||
max_frags: isSet(object.maxFrags)
|
||||
? globalThis.Number(object.maxFrags)
|
||||
: isSet(object.max_frags)
|
||||
? globalThis.Number(object.max_frags)
|
||||
: 0,
|
||||
max_xp: isSet(object.maxXp)
|
||||
? globalThis.Number(object.maxXp)
|
||||
: isSet(object.max_xp)
|
||||
? globalThis.Number(object.max_xp)
|
||||
: 0,
|
||||
shots: isSet(object.shots) ? globalThis.Number(object.shots) : 0,
|
||||
spotted: isSet(object.spotted) ? globalThis.Number(object.spotted) : 0,
|
||||
survived_battles: isSet(object.survivedBattles)
|
||||
? globalThis.Number(object.survivedBattles)
|
||||
: isSet(object.survived_battles)
|
||||
? globalThis.Number(object.survived_battles)
|
||||
: 0,
|
||||
win_and_survived: isSet(object.winAndSurvived)
|
||||
? globalThis.Number(object.winAndSurvived)
|
||||
: isSet(object.win_and_survived)
|
||||
? globalThis.Number(object.win_and_survived)
|
||||
: 0,
|
||||
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
||||
xp: isSet(object.xp) ? globalThis.Number(object.xp) : 0,
|
||||
battle_life_time: isSet(object.battleLifeTime)
|
||||
? globalThis.Number(object.battleLifeTime)
|
||||
: isSet(object.battle_life_time)
|
||||
? globalThis.Number(object.battle_life_time)
|
||||
: 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AverageDefinitionsAllStats): unknown {
|
||||
const obj: any = {};
|
||||
if (message.battles !== 0) {
|
||||
obj.battles = message.battles;
|
||||
}
|
||||
if (message.capture_points !== 0) {
|
||||
obj.capturePoints = message.capture_points;
|
||||
}
|
||||
if (message.damage_dealt !== 0) {
|
||||
obj.damageDealt = message.damage_dealt;
|
||||
}
|
||||
if (message.damage_received !== 0) {
|
||||
obj.damageReceived = message.damage_received;
|
||||
}
|
||||
if (message.dropped_capture_points !== 0) {
|
||||
obj.droppedCapturePoints = message.dropped_capture_points;
|
||||
}
|
||||
if (message.frags !== 0) {
|
||||
obj.frags = message.frags;
|
||||
}
|
||||
if (message.frags8p !== 0) {
|
||||
obj.frags8p = message.frags8p;
|
||||
}
|
||||
if (message.hits !== 0) {
|
||||
obj.hits = message.hits;
|
||||
}
|
||||
if (message.losses !== 0) {
|
||||
obj.losses = message.losses;
|
||||
}
|
||||
if (message.max_frags !== 0) {
|
||||
obj.maxFrags = message.max_frags;
|
||||
}
|
||||
if (message.max_xp !== 0) {
|
||||
obj.maxXp = message.max_xp;
|
||||
}
|
||||
if (message.shots !== 0) {
|
||||
obj.shots = message.shots;
|
||||
}
|
||||
if (message.spotted !== 0) {
|
||||
obj.spotted = message.spotted;
|
||||
}
|
||||
if (message.survived_battles !== 0) {
|
||||
obj.survivedBattles = message.survived_battles;
|
||||
}
|
||||
if (message.win_and_survived !== 0) {
|
||||
obj.winAndSurvived = message.win_and_survived;
|
||||
}
|
||||
if (message.wins !== 0) {
|
||||
obj.wins = message.wins;
|
||||
}
|
||||
if (message.xp !== 0) {
|
||||
obj.xp = message.xp;
|
||||
}
|
||||
if (message.battle_life_time !== 0) {
|
||||
obj.battleLifeTime = message.battle_life_time;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<AverageDefinitionsAllStats>, I>>(base?: I): AverageDefinitionsAllStats {
|
||||
return AverageDefinitionsAllStats.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitionsAllStats>, I>>(object: I): AverageDefinitionsAllStats {
|
||||
const message = createBaseAverageDefinitionsAllStats();
|
||||
message.battles = object.battles ?? 0;
|
||||
message.capture_points = object.capture_points ?? 0;
|
||||
message.damage_dealt = object.damage_dealt ?? 0;
|
||||
message.damage_received = object.damage_received ?? 0;
|
||||
message.dropped_capture_points = object.dropped_capture_points ?? 0;
|
||||
message.frags = object.frags ?? 0;
|
||||
message.frags8p = object.frags8p ?? 0;
|
||||
message.hits = object.hits ?? 0;
|
||||
message.losses = object.losses ?? 0;
|
||||
message.max_frags = object.max_frags ?? 0;
|
||||
message.max_xp = object.max_xp ?? 0;
|
||||
message.shots = object.shots ?? 0;
|
||||
message.spotted = object.spotted ?? 0;
|
||||
message.survived_battles = object.survived_battles ?? 0;
|
||||
message.win_and_survived = object.win_and_survived ?? 0;
|
||||
message.wins = object.wins ?? 0;
|
||||
message.xp = object.xp ?? 0;
|
||||
message.battle_life_time = object.battle_life_time ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseSamples(): Samples {
|
||||
return { d_1: 0, d_7: 0, d_30: 0, d_60: 0, d_90: 0, d_120: 0, total: 0 };
|
||||
}
|
||||
|
||||
export const Samples: MessageFns<Samples> = {
|
||||
encode(message: Samples, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.d_1 !== 0) {
|
||||
writer.uint32(8).uint32(message.d_1);
|
||||
}
|
||||
if (message.d_7 !== 0) {
|
||||
writer.uint32(16).uint32(message.d_7);
|
||||
}
|
||||
if (message.d_30 !== 0) {
|
||||
writer.uint32(24).uint32(message.d_30);
|
||||
}
|
||||
if (message.d_60 !== 0) {
|
||||
writer.uint32(32).uint32(message.d_60);
|
||||
}
|
||||
if (message.d_90 !== 0) {
|
||||
writer.uint32(40).uint32(message.d_90);
|
||||
}
|
||||
if (message.d_120 !== 0) {
|
||||
writer.uint32(48).uint32(message.d_120);
|
||||
}
|
||||
if (message.total !== 0) {
|
||||
writer.uint32(56).uint32(message.total);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Samples {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSamples();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_1 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_7 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_30 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_60 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_90 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 48) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.d_120 = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 56) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.total = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Samples {
|
||||
return {
|
||||
d_1: isSet(object.d1) ? globalThis.Number(object.d1) : isSet(object.d_1) ? globalThis.Number(object.d_1) : 0,
|
||||
d_7: isSet(object.d7) ? globalThis.Number(object.d7) : isSet(object.d_7) ? globalThis.Number(object.d_7) : 0,
|
||||
d_30: isSet(object.d30) ? globalThis.Number(object.d30) : isSet(object.d_30) ? globalThis.Number(object.d_30) : 0,
|
||||
d_60: isSet(object.d60) ? globalThis.Number(object.d60) : isSet(object.d_60) ? globalThis.Number(object.d_60) : 0,
|
||||
d_90: isSet(object.d90) ? globalThis.Number(object.d90) : isSet(object.d_90) ? globalThis.Number(object.d_90) : 0,
|
||||
d_120: isSet(object.d120)
|
||||
? globalThis.Number(object.d120)
|
||||
: isSet(object.d_120)
|
||||
? globalThis.Number(object.d_120)
|
||||
: 0,
|
||||
total: isSet(object.total) ? globalThis.Number(object.total) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Samples): unknown {
|
||||
const obj: any = {};
|
||||
if (message.d_1 !== 0) {
|
||||
obj.d1 = Math.round(message.d_1);
|
||||
}
|
||||
if (message.d_7 !== 0) {
|
||||
obj.d7 = Math.round(message.d_7);
|
||||
}
|
||||
if (message.d_30 !== 0) {
|
||||
obj.d30 = Math.round(message.d_30);
|
||||
}
|
||||
if (message.d_60 !== 0) {
|
||||
obj.d60 = Math.round(message.d_60);
|
||||
}
|
||||
if (message.d_90 !== 0) {
|
||||
obj.d90 = Math.round(message.d_90);
|
||||
}
|
||||
if (message.d_120 !== 0) {
|
||||
obj.d120 = Math.round(message.d_120);
|
||||
}
|
||||
if (message.total !== 0) {
|
||||
obj.total = Math.round(message.total);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Samples>, I>>(base?: I): Samples {
|
||||
return Samples.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Samples>, I>>(object: I): Samples {
|
||||
const message = createBaseSamples();
|
||||
message.d_1 = object.d_1 ?? 0;
|
||||
message.d_7 = object.d_7 ?? 0;
|
||||
message.d_30 = object.d_30 ?? 0;
|
||||
message.d_60 = object.d_60 ?? 0;
|
||||
message.d_90 = object.d_90 ?? 0;
|
||||
message.d_120 = object.d_120 ?? 0;
|
||||
message.total = object.total ?? 0;
|
||||
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 };
|
||||
|
||||
function longToNumber(int64: { toString(): string }): number {
|
||||
const num = globalThis.Number(int64.toString());
|
||||
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
||||
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
||||
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,346 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: camouflage_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface CamouflageDefinitions {
|
||||
camouflages: { [key: number]: Camouflage };
|
||||
}
|
||||
|
||||
export interface CamouflageDefinitions_CamouflagesEntry {
|
||||
key: number;
|
||||
value: Camouflage | undefined;
|
||||
}
|
||||
|
||||
export interface Camouflage {
|
||||
id: number;
|
||||
name: I18nString | undefined;
|
||||
tank_name?: I18nString | undefined;
|
||||
tank_name_full?: I18nString | undefined;
|
||||
}
|
||||
|
||||
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
||||
return { camouflages: {} };
|
||||
}
|
||||
|
||||
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.camouflages).forEach(([key, value]: [string, Camouflage]) => {
|
||||
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflageDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.camouflages[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CamouflageDefinitions {
|
||||
return {
|
||||
camouflages: isObject(object.camouflages)
|
||||
? (globalThis.Object.entries(object.camouflages) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Camouflage }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CamouflageDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.camouflages) {
|
||||
const entries = globalThis.Object.entries(message.camouflages) as [string, Camouflage][];
|
||||
if (entries.length > 0) {
|
||||
obj.camouflages = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.camouflages[k] = Camouflage.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
|
||||
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
||||
const message = createBaseCamouflageDefinitions();
|
||||
message.camouflages = (globalThis.Object.entries(object.camouflages ?? {}) as [string, Camouflage][]).reduce(
|
||||
(acc: { [key: number]: Camouflage }, [key, value]: [string, Camouflage]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
|
||||
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Camouflage.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Camouflage.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Camouflage.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||
base?: I,
|
||||
): CamouflageDefinitions_CamouflagesEntry {
|
||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||
object: I,
|
||||
): CamouflageDefinitions_CamouflagesEntry {
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Camouflage.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCamouflage(): Camouflage {
|
||||
return { id: 0, name: undefined, tank_name: undefined, tank_name_full: undefined };
|
||||
}
|
||||
|
||||
export const Camouflage: MessageFns<Camouflage> = {
|
||||
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.tank_name !== undefined) {
|
||||
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
||||
}
|
||||
if (message.tank_name_full !== undefined) {
|
||||
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflage();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tank_name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tank_name_full = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Camouflage {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
tank_name: isSet(object.tankName)
|
||||
? I18nString.fromJSON(object.tankName)
|
||||
: isSet(object.tank_name)
|
||||
? I18nString.fromJSON(object.tank_name)
|
||||
: undefined,
|
||||
tank_name_full: isSet(object.tankNameFull)
|
||||
? I18nString.fromJSON(object.tankNameFull)
|
||||
: isSet(object.tank_name_full)
|
||||
? I18nString.fromJSON(object.tank_name_full)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Camouflage): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
if (message.tank_name !== undefined) {
|
||||
obj.tankName = I18nString.toJSON(message.tank_name);
|
||||
}
|
||||
if (message.tank_name_full !== undefined) {
|
||||
obj.tankNameFull = I18nString.toJSON(message.tank_name_full);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
||||
return Camouflage.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
|
||||
const message = createBaseCamouflage();
|
||||
message.id = object.id ?? 0;
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
||||
? I18nString.fromPartial(object.tank_name)
|
||||
: undefined;
|
||||
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
||||
? I18nString.fromPartial(object.tank_name_full)
|
||||
: undefined;
|
||||
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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,868 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: consumable_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export enum ConsumableTankCategoryFilterCategory {
|
||||
CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP = 0,
|
||||
}
|
||||
|
||||
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
|
||||
return ConsumableTankCategoryFilterCategory.CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP;
|
||||
default:
|
||||
throw new globalThis.Error(
|
||||
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
|
||||
switch (object) {
|
||||
case ConsumableTankCategoryFilterCategory.CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP:
|
||||
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
|
||||
default:
|
||||
throw new globalThis.Error(
|
||||
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export interface ConsumableDefinitions {
|
||||
consumables: { [key: number]: Consumable };
|
||||
}
|
||||
|
||||
export interface ConsumableDefinitions_ConsumablesEntry {
|
||||
key: number;
|
||||
value: Consumable | undefined;
|
||||
}
|
||||
|
||||
export interface Consumable {
|
||||
id: number;
|
||||
name: I18nString | undefined;
|
||||
cooldown: number;
|
||||
duration?: number | undefined;
|
||||
game_mode_exclusive: boolean;
|
||||
include: ConsumableTankFilter[];
|
||||
exclude: ConsumableTankFilter[];
|
||||
}
|
||||
|
||||
export interface ConsumableTankFilter {
|
||||
filter_type?:
|
||||
| { $case: "tiers"; value: ConsumableTankTierFilter }
|
||||
| { $case: "ids"; value: ConsumableTankIdsFilter }
|
||||
| { $case: "categories"; value: ConsumableTankCategoryFilter }
|
||||
| { $case: "nations"; value: ConsumableTankNationFilter }
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export interface ConsumableTankTierFilter {
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
|
||||
export interface ConsumableTankIdsFilter {
|
||||
ids: number[];
|
||||
}
|
||||
|
||||
export interface ConsumableTankCategoryFilter {
|
||||
categories: ConsumableTankCategoryFilterCategory[];
|
||||
}
|
||||
|
||||
export interface ConsumableTankNationFilter {
|
||||
nations: string[];
|
||||
}
|
||||
|
||||
function createBaseConsumableDefinitions(): ConsumableDefinitions {
|
||||
return { consumables: {} };
|
||||
}
|
||||
|
||||
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
||||
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.consumables).forEach(([key, value]: [string, Consumable]) => {
|
||||
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = ConsumableDefinitions_ConsumablesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.consumables[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableDefinitions {
|
||||
return {
|
||||
consumables: isObject(object.consumables)
|
||||
? (globalThis.Object.entries(object.consumables) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Consumable }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.consumables) {
|
||||
const entries = globalThis.Object.entries(message.consumables) as [string, Consumable][];
|
||||
if (entries.length > 0) {
|
||||
obj.consumables = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.consumables[k] = Consumable.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(base?: I): ConsumableDefinitions {
|
||||
return ConsumableDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
||||
const message = createBaseConsumableDefinitions();
|
||||
message.consumables = (globalThis.Object.entries(object.consumables ?? {}) as [string, Consumable][]).reduce(
|
||||
(acc: { [key: number]: Consumable }, [key, value]: [string, Consumable]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitions_ConsumablesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
|
||||
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Consumable.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Consumable.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Consumable.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableDefinitions_ConsumablesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Consumable.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
|
||||
base?: I,
|
||||
): ConsumableDefinitions_ConsumablesEntry {
|
||||
return ConsumableDefinitions_ConsumablesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
|
||||
object: I,
|
||||
): ConsumableDefinitions_ConsumablesEntry {
|
||||
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Consumable.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumable(): Consumable {
|
||||
return { id: 0, name: undefined, cooldown: 0, duration: 0, game_mode_exclusive: false, include: [], exclude: [] };
|
||||
}
|
||||
|
||||
export const Consumable: MessageFns<Consumable> = {
|
||||
encode(message: Consumable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.cooldown !== 0) {
|
||||
writer.uint32(24).uint32(message.cooldown);
|
||||
}
|
||||
if (message.duration !== undefined && message.duration !== 0) {
|
||||
writer.uint32(37).float(message.duration);
|
||||
}
|
||||
if (message.game_mode_exclusive !== false) {
|
||||
writer.uint32(40).bool(message.game_mode_exclusive);
|
||||
}
|
||||
for (const v of message.include) {
|
||||
ConsumableTankFilter.encode(v!, writer.uint32(50).fork()).join();
|
||||
}
|
||||
for (const v of message.exclude) {
|
||||
ConsumableTankFilter.encode(v!, writer.uint32(58).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumable();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.cooldown = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 37) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.duration = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.game_mode_exclusive = reader.bool();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Consumable {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
cooldown: isSet(object.cooldown) ? globalThis.Number(object.cooldown) : 0,
|
||||
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
||||
game_mode_exclusive: isSet(object.gameModeExclusive)
|
||||
? globalThis.Boolean(object.gameModeExclusive)
|
||||
: isSet(object.game_mode_exclusive)
|
||||
? globalThis.Boolean(object.game_mode_exclusive)
|
||||
: false,
|
||||
include: globalThis.Array.isArray(object?.include)
|
||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||
: [],
|
||||
exclude: globalThis.Array.isArray(object?.exclude)
|
||||
? object.exclude.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Consumable): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
if (message.cooldown !== 0) {
|
||||
obj.cooldown = Math.round(message.cooldown);
|
||||
}
|
||||
if (message.duration !== undefined && message.duration !== 0) {
|
||||
obj.duration = message.duration;
|
||||
}
|
||||
if (message.game_mode_exclusive !== false) {
|
||||
obj.gameModeExclusive = message.game_mode_exclusive;
|
||||
}
|
||||
if (message.include?.length) {
|
||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||
}
|
||||
if (message.exclude?.length) {
|
||||
obj.exclude = message.exclude.map((e) => ConsumableTankFilter.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Consumable>, I>>(base?: I): Consumable {
|
||||
return Consumable.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Consumable>, I>>(object: I): Consumable {
|
||||
const message = createBaseConsumable();
|
||||
message.id = object.id ?? 0;
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
message.cooldown = object.cooldown ?? 0;
|
||||
message.duration = object.duration ?? 0;
|
||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableTankFilter(): ConsumableTankFilter {
|
||||
return { filter_type: undefined };
|
||||
}
|
||||
|
||||
export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
||||
encode(message: ConsumableTankFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
switch (message.filter_type?.$case) {
|
||||
case "tiers":
|
||||
ConsumableTankTierFilter.encode(message.filter_type.value, writer.uint32(10).fork()).join();
|
||||
break;
|
||||
case "ids":
|
||||
ConsumableTankIdsFilter.encode(message.filter_type.value, writer.uint32(18).fork()).join();
|
||||
break;
|
||||
case "categories":
|
||||
ConsumableTankCategoryFilter.encode(message.filter_type.value, writer.uint32(26).fork()).join();
|
||||
break;
|
||||
case "nations":
|
||||
ConsumableTankNationFilter.encode(message.filter_type.value, writer.uint32(34).fork()).join();
|
||||
break;
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableTankFilter();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.decode(reader, reader.uint32()) };
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.decode(reader, reader.uint32()) };
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.filter_type = {
|
||||
$case: "categories",
|
||||
value: ConsumableTankCategoryFilter.decode(reader, reader.uint32()),
|
||||
};
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.filter_type = { $case: "nations", value: ConsumableTankNationFilter.decode(reader, reader.uint32()) };
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableTankFilter {
|
||||
return {
|
||||
filter_type: isSet(object.tiers)
|
||||
? { $case: "tiers", value: ConsumableTankTierFilter.fromJSON(object.tiers) }
|
||||
: isSet(object.ids)
|
||||
? { $case: "ids", value: ConsumableTankIdsFilter.fromJSON(object.ids) }
|
||||
: isSet(object.categories)
|
||||
? { $case: "categories", value: ConsumableTankCategoryFilter.fromJSON(object.categories) }
|
||||
: isSet(object.nations)
|
||||
? { $case: "nations", value: ConsumableTankNationFilter.fromJSON(object.nations) }
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableTankFilter): unknown {
|
||||
const obj: any = {};
|
||||
if (message.filter_type?.$case === "tiers") {
|
||||
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
|
||||
} else if (message.filter_type?.$case === "ids") {
|
||||
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
|
||||
} else if (message.filter_type?.$case === "categories") {
|
||||
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
|
||||
} else if (message.filter_type?.$case === "nations") {
|
||||
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(base?: I): ConsumableTankFilter {
|
||||
return ConsumableTankFilter.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
|
||||
const message = createBaseConsumableTankFilter();
|
||||
switch (object.filter_type?.$case) {
|
||||
case "tiers": {
|
||||
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||
message.filter_type = {
|
||||
$case: "tiers",
|
||||
value: ConsumableTankTierFilter.fromPartial(object.filter_type.value),
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "ids": {
|
||||
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "categories": {
|
||||
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||
message.filter_type = {
|
||||
$case: "categories",
|
||||
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "nations": {
|
||||
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||
message.filter_type = {
|
||||
$case: "nations",
|
||||
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
|
||||
return { min: 0, max: 0 };
|
||||
}
|
||||
|
||||
export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
||||
encode(message: ConsumableTankTierFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.min !== 0) {
|
||||
writer.uint32(8).uint32(message.min);
|
||||
}
|
||||
if (message.max !== 0) {
|
||||
writer.uint32(16).uint32(message.max);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableTankTierFilter();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.min = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.max = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableTankTierFilter {
|
||||
return {
|
||||
min: isSet(object.min) ? globalThis.Number(object.min) : 0,
|
||||
max: isSet(object.max) ? globalThis.Number(object.max) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableTankTierFilter): unknown {
|
||||
const obj: any = {};
|
||||
if (message.min !== 0) {
|
||||
obj.min = Math.round(message.min);
|
||||
}
|
||||
if (message.max !== 0) {
|
||||
obj.max = Math.round(message.max);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(base?: I): ConsumableTankTierFilter {
|
||||
return ConsumableTankTierFilter.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(object: I): ConsumableTankTierFilter {
|
||||
const message = createBaseConsumableTankTierFilter();
|
||||
message.min = object.min ?? 0;
|
||||
message.max = object.max ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
|
||||
return { ids: [] };
|
||||
}
|
||||
|
||||
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
||||
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.ids) {
|
||||
writer.uint32(8).uint32(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableTankIdsFilter();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag === 8) {
|
||||
message.ids.push(reader.uint32());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tag === 10) {
|
||||
const end2 = reader.uint32() + reader.pos;
|
||||
while (reader.pos < end2) {
|
||||
message.ids.push(reader.uint32());
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableTankIdsFilter {
|
||||
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableTankIdsFilter): unknown {
|
||||
const obj: any = {};
|
||||
if (message.ids?.length) {
|
||||
obj.ids = message.ids.map((e) => Math.round(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(base?: I): ConsumableTankIdsFilter {
|
||||
return ConsumableTankIdsFilter.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(object: I): ConsumableTankIdsFilter {
|
||||
const message = createBaseConsumableTankIdsFilter();
|
||||
message.ids = object.ids?.map((e) => e) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter {
|
||||
return { categories: [] };
|
||||
}
|
||||
|
||||
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
|
||||
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.categories) {
|
||||
writer.uint32(8).int32(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableTankCategoryFilter();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag === 8) {
|
||||
message.categories.push(reader.int32() as any);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tag === 10) {
|
||||
const end2 = reader.uint32() + reader.pos;
|
||||
while (reader.pos < end2) {
|
||||
message.categories.push(reader.int32() as any);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableTankCategoryFilter {
|
||||
return {
|
||||
categories: globalThis.Array.isArray(object?.categories)
|
||||
? object.categories.map((e: any) => consumableTankCategoryFilterCategoryFromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableTankCategoryFilter): unknown {
|
||||
const obj: any = {};
|
||||
if (message.categories?.length) {
|
||||
obj.categories = message.categories.map((e) => consumableTankCategoryFilterCategoryToJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(base?: I): ConsumableTankCategoryFilter {
|
||||
return ConsumableTankCategoryFilter.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(object: I): ConsumableTankCategoryFilter {
|
||||
const message = createBaseConsumableTankCategoryFilter();
|
||||
message.categories = object.categories?.map((e) => e) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
|
||||
return { nations: [] };
|
||||
}
|
||||
|
||||
export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter> = {
|
||||
encode(message: ConsumableTankNationFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.nations) {
|
||||
writer.uint32(10).string(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseConsumableTankNationFilter();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.nations.push(reader.string());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ConsumableTankNationFilter {
|
||||
return {
|
||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ConsumableTankNationFilter): unknown {
|
||||
const obj: any = {};
|
||||
if (message.nations?.length) {
|
||||
obj.nations = message.nations;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(base?: I): ConsumableTankNationFilter {
|
||||
return ConsumableTankNationFilter.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(object: I): ConsumableTankNationFilter {
|
||||
const message = createBaseConsumableTankNationFilter();
|
||||
message.nations = object.nations?.map((e) => 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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,576 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: equipment_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface EquipmentDefinitions {
|
||||
presets: { [key: string]: EquipmentPreset };
|
||||
equipments: { [key: number]: Equipment };
|
||||
}
|
||||
|
||||
export interface EquipmentDefinitions_PresetsEntry {
|
||||
key: string;
|
||||
value: EquipmentPreset | undefined;
|
||||
}
|
||||
|
||||
export interface EquipmentDefinitions_EquipmentsEntry {
|
||||
key: number;
|
||||
value: Equipment | undefined;
|
||||
}
|
||||
|
||||
export interface Equipment {
|
||||
name: I18nString | undefined;
|
||||
description: I18nString | undefined;
|
||||
}
|
||||
|
||||
export interface EquipmentPreset {
|
||||
slots: EquipmentSlot[];
|
||||
}
|
||||
|
||||
export interface EquipmentSlot {
|
||||
left: number;
|
||||
right: number;
|
||||
}
|
||||
|
||||
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
|
||||
return { presets: {}, equipments: {} };
|
||||
}
|
||||
|
||||
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.presets).forEach(([key, value]: [string, EquipmentPreset]) => {
|
||||
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
globalThis.Object.entries(message.equipments).forEach(([key, value]: [string, Equipment]) => {
|
||||
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = EquipmentDefinitions_PresetsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.presets[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(reader, reader.uint32());
|
||||
if (entry2.value !== undefined) {
|
||||
message.equipments[entry2.key] = entry2.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentDefinitions {
|
||||
return {
|
||||
presets: isObject(object.presets)
|
||||
? (globalThis.Object.entries(object.presets) as [string, any][]).reduce(
|
||||
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, any]) => {
|
||||
acc[key] = EquipmentPreset.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
equipments: isObject(object.equipments)
|
||||
? (globalThis.Object.entries(object.equipments) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Equipment }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.presets) {
|
||||
const entries = globalThis.Object.entries(message.presets) as [string, EquipmentPreset][];
|
||||
if (entries.length > 0) {
|
||||
obj.presets = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.presets[k] = EquipmentPreset.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (message.equipments) {
|
||||
const entries = globalThis.Object.entries(message.equipments) as [string, Equipment][];
|
||||
if (entries.length > 0) {
|
||||
obj.equipments = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.equipments[k] = Equipment.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(base?: I): EquipmentDefinitions {
|
||||
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
||||
const message = createBaseEquipmentDefinitions();
|
||||
message.presets = (globalThis.Object.entries(object.presets ?? {}) as [string, EquipmentPreset][]).reduce(
|
||||
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, EquipmentPreset]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = EquipmentPreset.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
message.equipments = (globalThis.Object.entries(object.equipments ?? {}) as [string, Equipment][]).reduce(
|
||||
(acc: { [key: number]: Equipment }, [key, value]: [string, Equipment]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
||||
return { key: "", value: undefined };
|
||||
}
|
||||
|
||||
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
|
||||
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== "") {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = EquipmentPreset.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||
value: isSet(object.value) ? EquipmentPreset.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== "") {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = EquipmentPreset.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
||||
base?: I,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
||||
object: I,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
message.key = object.key ?? "";
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? EquipmentPreset.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
|
||||
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Equipment.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Equipment.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Equipment.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Equipment.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
||||
base?: I,
|
||||
): EquipmentDefinitions_EquipmentsEntry {
|
||||
return EquipmentDefinitions_EquipmentsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
||||
object: I,
|
||||
): EquipmentDefinitions_EquipmentsEntry {
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Equipment.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipment(): Equipment {
|
||||
return { name: undefined, description: undefined };
|
||||
}
|
||||
|
||||
export const Equipment: MessageFns<Equipment> = {
|
||||
encode(message: Equipment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||
}
|
||||
if (message.description !== undefined) {
|
||||
I18nString.encode(message.description, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipment();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Equipment {
|
||||
return {
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
description: isSet(object.description) ? I18nString.fromJSON(object.description) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Equipment): unknown {
|
||||
const obj: any = {};
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
if (message.description !== undefined) {
|
||||
obj.description = I18nString.toJSON(message.description);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
|
||||
return Equipment.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(object: I): Equipment {
|
||||
const message = createBaseEquipment();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
message.description = (object.description !== undefined && object.description !== null)
|
||||
? I18nString.fromPartial(object.description)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentPreset(): EquipmentPreset {
|
||||
return { slots: [] };
|
||||
}
|
||||
|
||||
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
||||
encode(message: EquipmentPreset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.slots) {
|
||||
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentPreset();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.slots.push(EquipmentSlot.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentPreset {
|
||||
return {
|
||||
slots: globalThis.Array.isArray(object?.slots) ? object.slots.map((e: any) => EquipmentSlot.fromJSON(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentPreset): unknown {
|
||||
const obj: any = {};
|
||||
if (message.slots?.length) {
|
||||
obj.slots = message.slots.map((e) => EquipmentSlot.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(base?: I): EquipmentPreset {
|
||||
return EquipmentPreset.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(object: I): EquipmentPreset {
|
||||
const message = createBaseEquipmentPreset();
|
||||
message.slots = object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentSlot(): EquipmentSlot {
|
||||
return { left: 0, right: 0 };
|
||||
}
|
||||
|
||||
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
||||
encode(message: EquipmentSlot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.left !== 0) {
|
||||
writer.uint32(8).uint32(message.left);
|
||||
}
|
||||
if (message.right !== 0) {
|
||||
writer.uint32(16).uint32(message.right);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentSlot();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.left = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.right = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentSlot {
|
||||
return {
|
||||
left: isSet(object.left) ? globalThis.Number(object.left) : 0,
|
||||
right: isSet(object.right) ? globalThis.Number(object.right) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentSlot): unknown {
|
||||
const obj: any = {};
|
||||
if (message.left !== 0) {
|
||||
obj.left = Math.round(message.left);
|
||||
}
|
||||
if (message.right !== 0) {
|
||||
obj.right = Math.round(message.right);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(base?: I): EquipmentSlot {
|
||||
return EquipmentSlot.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(object: I): EquipmentSlot {
|
||||
const message = createBaseEquipmentSlot();
|
||||
message.left = object.left ?? 0;
|
||||
message.right = object.right ?? 0;
|
||||
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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,201 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: gallery.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface Gallery {
|
||||
avatars: Avatar[];
|
||||
}
|
||||
|
||||
export interface Avatar {
|
||||
id: string;
|
||||
name: I18nString | undefined;
|
||||
extension: string;
|
||||
}
|
||||
|
||||
function createBaseGallery(): Gallery {
|
||||
return { avatars: [] };
|
||||
}
|
||||
|
||||
export const Gallery: MessageFns<Gallery> = {
|
||||
encode(message: Gallery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.avatars) {
|
||||
Avatar.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Gallery {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGallery();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.avatars.push(Avatar.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Gallery {
|
||||
return {
|
||||
avatars: globalThis.Array.isArray(object?.avatars) ? object.avatars.map((e: any) => Avatar.fromJSON(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Gallery): unknown {
|
||||
const obj: any = {};
|
||||
if (message.avatars?.length) {
|
||||
obj.avatars = message.avatars.map((e) => Avatar.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Gallery>, I>>(base?: I): Gallery {
|
||||
return Gallery.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Gallery>, I>>(object: I): Gallery {
|
||||
const message = createBaseGallery();
|
||||
message.avatars = object.avatars?.map((e) => Avatar.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAvatar(): Avatar {
|
||||
return { id: "", name: undefined, extension: "" };
|
||||
}
|
||||
|
||||
export const Avatar: MessageFns<Avatar> = {
|
||||
encode(message: Avatar, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.extension !== "") {
|
||||
writer.uint32(26).string(message.extension);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Avatar {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAvatar();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.extension = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Avatar {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
extension: isSet(object.extension) ? globalThis.String(object.extension) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Avatar): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== "") {
|
||||
obj.id = message.id;
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
if (message.extension !== "") {
|
||||
obj.extension = message.extension;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Avatar>, I>>(base?: I): Avatar {
|
||||
return Avatar.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Avatar>, I>>(object: I): Avatar {
|
||||
const message = createBaseAvatar();
|
||||
message.id = object.id ?? "";
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
message.extension = object.extension ?? "";
|
||||
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 };
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,543 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: game_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface GameDefinitions {
|
||||
version: string;
|
||||
nations: string[];
|
||||
gameModes: { [key: number]: GameMode };
|
||||
roles: { [key: number]: GameModeRole };
|
||||
}
|
||||
|
||||
export interface GameDefinitions_GameModesEntry {
|
||||
key: number;
|
||||
value: GameMode | undefined;
|
||||
}
|
||||
|
||||
export interface GameDefinitions_RolesEntry {
|
||||
key: number;
|
||||
value: GameModeRole | undefined;
|
||||
}
|
||||
|
||||
export interface GameMode {
|
||||
name: I18nString | undefined;
|
||||
}
|
||||
|
||||
export interface GameModeRole {
|
||||
provisions: number[];
|
||||
consumables: number[];
|
||||
}
|
||||
|
||||
function createBaseGameDefinitions(): GameDefinitions {
|
||||
return { version: "", nations: [], gameModes: {}, roles: {} };
|
||||
}
|
||||
|
||||
export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.version !== "") {
|
||||
writer.uint32(10).string(message.version);
|
||||
}
|
||||
for (const v of message.nations) {
|
||||
writer.uint32(18).string(v!);
|
||||
}
|
||||
globalThis.Object.entries(message.gameModes).forEach(([key, value]: [string, GameMode]) => {
|
||||
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
||||
});
|
||||
globalThis.Object.entries(message.roles).forEach(([key, value]: [string, GameModeRole]) => {
|
||||
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.version = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.nations.push(reader.string());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
|
||||
if (entry3.value !== undefined) {
|
||||
message.gameModes[entry3.key] = entry3.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
|
||||
if (entry4.value !== undefined) {
|
||||
message.roles[entry4.key] = entry4.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameDefinitions {
|
||||
return {
|
||||
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
||||
gameModes: isObject(object.gameModes)
|
||||
? (globalThis.Object.entries(object.gameModes) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: GameMode }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
roles: isObject(object.roles)
|
||||
? (globalThis.Object.entries(object.roles) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: GameModeRole }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.version !== "") {
|
||||
obj.version = message.version;
|
||||
}
|
||||
if (message.nations?.length) {
|
||||
obj.nations = message.nations;
|
||||
}
|
||||
if (message.gameModes) {
|
||||
const entries = globalThis.Object.entries(message.gameModes) as [string, GameMode][];
|
||||
if (entries.length > 0) {
|
||||
obj.gameModes = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.gameModes[k] = GameMode.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (message.roles) {
|
||||
const entries = globalThis.Object.entries(message.roles) as [string, GameModeRole][];
|
||||
if (entries.length > 0) {
|
||||
obj.roles = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.roles[k] = GameModeRole.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(base?: I): GameDefinitions {
|
||||
return GameDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
|
||||
const message = createBaseGameDefinitions();
|
||||
message.version = object.version ?? "";
|
||||
message.nations = object.nations?.map((e) => e) || [];
|
||||
message.gameModes = (globalThis.Object.entries(object.gameModes ?? {}) as [string, GameMode][]).reduce(
|
||||
(acc: { [key: number]: GameMode }, [key, value]: [string, GameMode]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
message.roles = (globalThis.Object.entries(object.roles ?? {}) as [string, GameModeRole][]).reduce(
|
||||
(acc: { [key: number]: GameModeRole }, [key, value]: [string, GameModeRole]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
||||
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameMode.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameMode.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? GameMode.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameMode.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(base?: I): GameDefinitions_GameModesEntry {
|
||||
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
|
||||
object: I,
|
||||
): GameDefinitions_GameModesEntry {
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? GameMode.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
|
||||
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameModeRole.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameDefinitions_RolesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? GameModeRole.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_RolesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameModeRole.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(base?: I): GameDefinitions_RolesEntry {
|
||||
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(object: I): GameDefinitions_RolesEntry {
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? GameModeRole.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameMode(): GameMode {
|
||||
return { name: undefined };
|
||||
}
|
||||
|
||||
export const GameMode: MessageFns<GameMode> = {
|
||||
encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameMode();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameMode {
|
||||
return { name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: GameMode): unknown {
|
||||
const obj: any = {};
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameMode>, I>>(base?: I): GameMode {
|
||||
return GameMode.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
|
||||
const message = createBaseGameMode();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameModeRole(): GameModeRole {
|
||||
return { provisions: [], consumables: [] };
|
||||
}
|
||||
|
||||
export const GameModeRole: MessageFns<GameModeRole> = {
|
||||
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.provisions) {
|
||||
writer.uint32(8).uint32(v!);
|
||||
}
|
||||
for (const v of message.consumables) {
|
||||
writer.uint32(16).uint32(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameModeRole();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag === 8) {
|
||||
message.provisions.push(reader.uint32());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tag === 10) {
|
||||
const end2 = reader.uint32() + reader.pos;
|
||||
while (reader.pos < end2) {
|
||||
message.provisions.push(reader.uint32());
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag === 16) {
|
||||
message.consumables.push(reader.uint32());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tag === 18) {
|
||||
const end2 = reader.uint32() + reader.pos;
|
||||
while (reader.pos < end2) {
|
||||
message.consumables.push(reader.uint32());
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameModeRole {
|
||||
return {
|
||||
provisions: globalThis.Array.isArray(object?.provisions)
|
||||
? object.provisions.map((e: any) => globalThis.Number(e))
|
||||
: [],
|
||||
consumables: globalThis.Array.isArray(object?.consumables)
|
||||
? object.consumables.map((e: any) => globalThis.Number(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameModeRole): unknown {
|
||||
const obj: any = {};
|
||||
if (message.provisions?.length) {
|
||||
obj.provisions = message.provisions.map((e) => Math.round(e));
|
||||
}
|
||||
if (message.consumables?.length) {
|
||||
obj.consumables = message.consumables.map((e) => Math.round(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameModeRole>, I>>(base?: I): GameModeRole {
|
||||
return GameModeRole.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
|
||||
const message = createBaseGameModeRole();
|
||||
message.provisions = object.provisions?.map((e) => e) || [];
|
||||
message.consumables = object.consumables?.map((e) => 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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: i18n.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface I18nString {
|
||||
locales: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface I18nString_LocalesEntry {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
function createBaseI18nString(): I18nString {
|
||||
return { locales: {} };
|
||||
}
|
||||
|
||||
export const I18nString: MessageFns<I18nString> = {
|
||||
encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.locales).forEach(([key, value]: [string, string]) => {
|
||||
I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): I18nString {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseI18nString();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = I18nString_LocalesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.locales[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): I18nString {
|
||||
return {
|
||||
locales: isObject(object.locales)
|
||||
? (globalThis.Object.entries(object.locales) as [string, any][]).reduce(
|
||||
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
||||
acc[key] = globalThis.String(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: I18nString): unknown {
|
||||
const obj: any = {};
|
||||
if (message.locales) {
|
||||
const entries = globalThis.Object.entries(message.locales) as [string, string][];
|
||||
if (entries.length > 0) {
|
||||
obj.locales = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.locales[k] = v;
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<I18nString>, I>>(base?: I): I18nString {
|
||||
return I18nString.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
|
||||
const message = createBaseI18nString();
|
||||
message.locales = (globalThis.Object.entries(object.locales ?? {}) as [string, string][]).reduce(
|
||||
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = globalThis.String(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry {
|
||||
return { key: "", value: "" };
|
||||
}
|
||||
|
||||
export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
|
||||
encode(message: I18nString_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== "") {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== "") {
|
||||
writer.uint32(18).string(message.value);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): I18nString_LocalesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseI18nString_LocalesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): I18nString_LocalesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: I18nString_LocalesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== "") {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.value !== "") {
|
||||
obj.value = message.value;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>(base?: I): I18nString_LocalesEntry {
|
||||
return I18nString_LocalesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>(object: I): I18nString_LocalesEntry {
|
||||
const message = createBaseI18nString_LocalesEntry();
|
||||
message.key = object.key ?? "";
|
||||
message.value = object.value ?? "";
|
||||
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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// @ts-nocheck
|
||||
export * from "./average_definitions.ts";
|
||||
export * from "./camouflage_definitions.ts";
|
||||
export * from "./consumable_definitions.ts";
|
||||
export * from "./equipment_definitions.ts";
|
||||
export * from "./gallery.ts";
|
||||
export * from "./game_definitions.ts";
|
||||
export * from "./i18n.ts";
|
||||
export * from "./map_definitions.ts";
|
||||
export * from "./model_definitions.ts";
|
||||
export * from "./popular_tanks.ts";
|
||||
export * from "./provision_definitions.ts";
|
||||
export * from "./rating_leaderboard.ts";
|
||||
export * from "./reviews.ts";
|
||||
export * from "./skill_definitions.ts";
|
||||
export * from "./tank_definitions.ts";
|
||||
@@ -1,296 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: map_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface MapDefinitions {
|
||||
maps: { [key: number]: MapDefinition };
|
||||
}
|
||||
|
||||
export interface MapDefinitions_MapsEntry {
|
||||
key: number;
|
||||
value: MapDefinition | undefined;
|
||||
}
|
||||
|
||||
export interface MapDefinition {
|
||||
id: number;
|
||||
name: I18nString | undefined;
|
||||
}
|
||||
|
||||
function createBaseMapDefinitions(): MapDefinitions {
|
||||
return { maps: {} };
|
||||
}
|
||||
|
||||
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.maps).forEach(([key, value]: [string, MapDefinition]) => {
|
||||
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMapDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = MapDefinitions_MapsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.maps[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MapDefinitions {
|
||||
return {
|
||||
maps: isObject(object.maps)
|
||||
? (globalThis.Object.entries(object.maps) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: MapDefinition }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MapDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.maps) {
|
||||
const entries = globalThis.Object.entries(message.maps) as [string, MapDefinition][];
|
||||
if (entries.length > 0) {
|
||||
obj.maps = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.maps[k] = MapDefinition.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(base?: I): MapDefinitions {
|
||||
return MapDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
||||
const message = createBaseMapDefinitions();
|
||||
message.maps = (globalThis.Object.entries(object.maps ?? {}) as [string, MapDefinition][]).reduce(
|
||||
(acc: { [key: number]: MapDefinition }, [key, value]: [string, MapDefinition]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).int32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
MapDefinition.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMapDefinitions_MapsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.int32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = MapDefinition.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MapDefinitions_MapsEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? MapDefinition.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MapDefinitions_MapsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = MapDefinition.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(base?: I): MapDefinitions_MapsEntry {
|
||||
return MapDefinitions_MapsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(object: I): MapDefinitions_MapsEntry {
|
||||
const message = createBaseMapDefinitions_MapsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? MapDefinition.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMapDefinition(): MapDefinition {
|
||||
return { id: 0, name: undefined };
|
||||
}
|
||||
|
||||
export const MapDefinition: MessageFns<MapDefinition> = {
|
||||
encode(message: MapDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMapDefinition();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MapDefinition {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MapDefinition): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<MapDefinition>, I>>(base?: I): MapDefinition {
|
||||
return MapDefinition.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(object: I): MapDefinition {
|
||||
const message = createBaseMapDefinition();
|
||||
message.id = object.id ?? 0;
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,182 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: popular_tanks.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface PopularTanks {
|
||||
tanks: PopularTank[];
|
||||
}
|
||||
|
||||
export interface PopularTank {
|
||||
id: number;
|
||||
/** views in the last 7 days */
|
||||
views: number;
|
||||
}
|
||||
|
||||
function createBasePopularTanks(): PopularTanks {
|
||||
return { tanks: [] };
|
||||
}
|
||||
|
||||
export const PopularTanks: MessageFns<PopularTanks> = {
|
||||
encode(message: PopularTanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.tanks) {
|
||||
PopularTank.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): PopularTanks {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePopularTanks();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tanks.push(PopularTank.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PopularTanks {
|
||||
return {
|
||||
tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => PopularTank.fromJSON(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PopularTanks): unknown {
|
||||
const obj: any = {};
|
||||
if (message.tanks?.length) {
|
||||
obj.tanks = message.tanks.map((e) => PopularTank.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PopularTanks>, I>>(base?: I): PopularTanks {
|
||||
return PopularTanks.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PopularTanks>, I>>(object: I): PopularTanks {
|
||||
const message = createBasePopularTanks();
|
||||
message.tanks = object.tanks?.map((e) => PopularTank.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePopularTank(): PopularTank {
|
||||
return { id: 0, views: 0 };
|
||||
}
|
||||
|
||||
export const PopularTank: MessageFns<PopularTank> = {
|
||||
encode(message: PopularTank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.views !== 0) {
|
||||
writer.uint32(16).uint32(message.views);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): PopularTank {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePopularTank();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.views = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PopularTank {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
views: isSet(object.views) ? globalThis.Number(object.views) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PopularTank): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.views !== 0) {
|
||||
obj.views = Math.round(message.views);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PopularTank>, I>>(base?: I): PopularTank {
|
||||
return PopularTank.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PopularTank>, I>>(object: I): PopularTank {
|
||||
const message = createBasePopularTank();
|
||||
message.id = object.id ?? 0;
|
||||
message.views = object.views ?? 0;
|
||||
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 };
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,377 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: provision_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { ConsumableTankFilter } from "./consumable_definitions";
|
||||
import { I18nString } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface ProvisionDefinitions {
|
||||
provisions: { [key: number]: Provision };
|
||||
}
|
||||
|
||||
export interface ProvisionDefinitions_ProvisionsEntry {
|
||||
key: number;
|
||||
value: Provision | undefined;
|
||||
}
|
||||
|
||||
export interface Provision {
|
||||
id: number;
|
||||
name: I18nString | undefined;
|
||||
crew?: number | undefined;
|
||||
game_mode_exclusive: boolean;
|
||||
include: ConsumableTankFilter[];
|
||||
exclude: ConsumableTankFilter[];
|
||||
}
|
||||
|
||||
function createBaseProvisionDefinitions(): ProvisionDefinitions {
|
||||
return { provisions: {} };
|
||||
}
|
||||
|
||||
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.provisions).forEach(([key, value]: [string, Provision]) => {
|
||||
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseProvisionDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.provisions[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ProvisionDefinitions {
|
||||
return {
|
||||
provisions: isObject(object.provisions)
|
||||
? (globalThis.Object.entries(object.provisions) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Provision }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ProvisionDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.provisions) {
|
||||
const entries = globalThis.Object.entries(message.provisions) as [string, Provision][];
|
||||
if (entries.length > 0) {
|
||||
obj.provisions = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.provisions[k] = Provision.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(base?: I): ProvisionDefinitions {
|
||||
return ProvisionDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
||||
const message = createBaseProvisionDefinitions();
|
||||
message.provisions = (globalThis.Object.entries(object.provisions ?? {}) as [string, Provision][]).reduce(
|
||||
(acc: { [key: number]: Provision }, [key, value]: [string, Provision]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_ProvisionsEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
|
||||
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Provision.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Provision.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Provision.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Provision.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
||||
base?: I,
|
||||
): ProvisionDefinitions_ProvisionsEntry {
|
||||
return ProvisionDefinitions_ProvisionsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
||||
object: I,
|
||||
): ProvisionDefinitions_ProvisionsEntry {
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Provision.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseProvision(): Provision {
|
||||
return { id: 0, name: undefined, crew: 0, game_mode_exclusive: false, include: [], exclude: [] };
|
||||
}
|
||||
|
||||
export const Provision: MessageFns<Provision> = {
|
||||
encode(message: Provision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||
}
|
||||
if (message.crew !== undefined && message.crew !== 0) {
|
||||
writer.uint32(29).float(message.crew);
|
||||
}
|
||||
if (message.game_mode_exclusive !== false) {
|
||||
writer.uint32(40).bool(message.game_mode_exclusive);
|
||||
}
|
||||
for (const v of message.include) {
|
||||
ConsumableTankFilter.encode(v!, writer.uint32(50).fork()).join();
|
||||
}
|
||||
for (const v of message.exclude) {
|
||||
ConsumableTankFilter.encode(v!, writer.uint32(58).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseProvision();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = I18nString.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 29) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.crew = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.game_mode_exclusive = reader.bool();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Provision {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||
crew: isSet(object.crew) ? globalThis.Number(object.crew) : 0,
|
||||
game_mode_exclusive: isSet(object.gameModeExclusive)
|
||||
? globalThis.Boolean(object.gameModeExclusive)
|
||||
: isSet(object.game_mode_exclusive)
|
||||
? globalThis.Boolean(object.game_mode_exclusive)
|
||||
: false,
|
||||
include: globalThis.Array.isArray(object?.include)
|
||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||
: [],
|
||||
exclude: globalThis.Array.isArray(object?.exclude)
|
||||
? object.exclude.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Provision): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18nString.toJSON(message.name);
|
||||
}
|
||||
if (message.crew !== undefined && message.crew !== 0) {
|
||||
obj.crew = message.crew;
|
||||
}
|
||||
if (message.game_mode_exclusive !== false) {
|
||||
obj.gameModeExclusive = message.game_mode_exclusive;
|
||||
}
|
||||
if (message.include?.length) {
|
||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||
}
|
||||
if (message.exclude?.length) {
|
||||
obj.exclude = message.exclude.map((e) => ConsumableTankFilter.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
|
||||
return Provision.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(object: I): Provision {
|
||||
const message = createBaseProvision();
|
||||
message.id = object.id ?? 0;
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: undefined;
|
||||
message.crew = object.crew ?? 0;
|
||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,511 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: rating_leaderboard.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface RatingLeaderboard {
|
||||
version?: { $case: "v1"; value: RatingLeaderboardV1 } | { $case: "v2"; value: RatingLeaderboardV2 } | undefined;
|
||||
}
|
||||
|
||||
export interface RatingLeaderboardV1 {
|
||||
entries: RatingLeaderboardEntryV1[];
|
||||
}
|
||||
|
||||
export interface RatingLeaderboardEntryV1 {
|
||||
id: number;
|
||||
score: number;
|
||||
}
|
||||
|
||||
export interface RatingLeaderboardV2 {
|
||||
entries: RatingLeaderboardEntryV2[];
|
||||
}
|
||||
|
||||
export interface RatingLeaderboardEntryV2 {
|
||||
id: number;
|
||||
score: number;
|
||||
battles: number;
|
||||
wins: number;
|
||||
survived: number;
|
||||
damage: number;
|
||||
kills: number;
|
||||
}
|
||||
|
||||
function createBaseRatingLeaderboard(): RatingLeaderboard {
|
||||
return { version: undefined };
|
||||
}
|
||||
|
||||
export const RatingLeaderboard: MessageFns<RatingLeaderboard> = {
|
||||
encode(message: RatingLeaderboard, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
switch (message.version?.$case) {
|
||||
case "v1":
|
||||
RatingLeaderboardV1.encode(message.version.value, writer.uint32(10).fork()).join();
|
||||
break;
|
||||
case "v2":
|
||||
RatingLeaderboardV2.encode(message.version.value, writer.uint32(18).fork()).join();
|
||||
break;
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboard {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseRatingLeaderboard();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.version = { $case: "v1", value: RatingLeaderboardV1.decode(reader, reader.uint32()) };
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.version = { $case: "v2", value: RatingLeaderboardV2.decode(reader, reader.uint32()) };
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): RatingLeaderboard {
|
||||
return {
|
||||
version: isSet(object.v1)
|
||||
? { $case: "v1", value: RatingLeaderboardV1.fromJSON(object.v1) }
|
||||
: isSet(object.v2)
|
||||
? { $case: "v2", value: RatingLeaderboardV2.fromJSON(object.v2) }
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: RatingLeaderboard): unknown {
|
||||
const obj: any = {};
|
||||
if (message.version?.$case === "v1") {
|
||||
obj.v1 = RatingLeaderboardV1.toJSON(message.version.value);
|
||||
} else if (message.version?.$case === "v2") {
|
||||
obj.v2 = RatingLeaderboardV2.toJSON(message.version.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<RatingLeaderboard>, I>>(base?: I): RatingLeaderboard {
|
||||
return RatingLeaderboard.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboard>, I>>(object: I): RatingLeaderboard {
|
||||
const message = createBaseRatingLeaderboard();
|
||||
switch (object.version?.$case) {
|
||||
case "v1": {
|
||||
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||
message.version = { $case: "v1", value: RatingLeaderboardV1.fromPartial(object.version.value) };
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "v2": {
|
||||
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||
message.version = { $case: "v2", value: RatingLeaderboardV2.fromPartial(object.version.value) };
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseRatingLeaderboardV1(): RatingLeaderboardV1 {
|
||||
return { entries: [] };
|
||||
}
|
||||
|
||||
export const RatingLeaderboardV1: MessageFns<RatingLeaderboardV1> = {
|
||||
encode(message: RatingLeaderboardV1, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.entries) {
|
||||
RatingLeaderboardEntryV1.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV1 {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseRatingLeaderboardV1();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.entries.push(RatingLeaderboardEntryV1.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): RatingLeaderboardV1 {
|
||||
return {
|
||||
entries: globalThis.Array.isArray(object?.entries)
|
||||
? object.entries.map((e: any) => RatingLeaderboardEntryV1.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: RatingLeaderboardV1): unknown {
|
||||
const obj: any = {};
|
||||
if (message.entries?.length) {
|
||||
obj.entries = message.entries.map((e) => RatingLeaderboardEntryV1.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<RatingLeaderboardV1>, I>>(base?: I): RatingLeaderboardV1 {
|
||||
return RatingLeaderboardV1.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboardV1>, I>>(object: I): RatingLeaderboardV1 {
|
||||
const message = createBaseRatingLeaderboardV1();
|
||||
message.entries = object.entries?.map((e) => RatingLeaderboardEntryV1.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseRatingLeaderboardEntryV1(): RatingLeaderboardEntryV1 {
|
||||
return { id: 0, score: 0 };
|
||||
}
|
||||
|
||||
export const RatingLeaderboardEntryV1: MessageFns<RatingLeaderboardEntryV1> = {
|
||||
encode(message: RatingLeaderboardEntryV1, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.score !== 0) {
|
||||
writer.uint32(16).uint32(message.score);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV1 {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseRatingLeaderboardEntryV1();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.score = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): RatingLeaderboardEntryV1 {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
score: isSet(object.score) ? globalThis.Number(object.score) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: RatingLeaderboardEntryV1): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.score !== 0) {
|
||||
obj.score = Math.round(message.score);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<RatingLeaderboardEntryV1>, I>>(base?: I): RatingLeaderboardEntryV1 {
|
||||
return RatingLeaderboardEntryV1.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboardEntryV1>, I>>(object: I): RatingLeaderboardEntryV1 {
|
||||
const message = createBaseRatingLeaderboardEntryV1();
|
||||
message.id = object.id ?? 0;
|
||||
message.score = object.score ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseRatingLeaderboardV2(): RatingLeaderboardV2 {
|
||||
return { entries: [] };
|
||||
}
|
||||
|
||||
export const RatingLeaderboardV2: MessageFns<RatingLeaderboardV2> = {
|
||||
encode(message: RatingLeaderboardV2, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.entries) {
|
||||
RatingLeaderboardEntryV2.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV2 {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseRatingLeaderboardV2();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.entries.push(RatingLeaderboardEntryV2.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): RatingLeaderboardV2 {
|
||||
return {
|
||||
entries: globalThis.Array.isArray(object?.entries)
|
||||
? object.entries.map((e: any) => RatingLeaderboardEntryV2.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: RatingLeaderboardV2): unknown {
|
||||
const obj: any = {};
|
||||
if (message.entries?.length) {
|
||||
obj.entries = message.entries.map((e) => RatingLeaderboardEntryV2.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<RatingLeaderboardV2>, I>>(base?: I): RatingLeaderboardV2 {
|
||||
return RatingLeaderboardV2.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboardV2>, I>>(object: I): RatingLeaderboardV2 {
|
||||
const message = createBaseRatingLeaderboardV2();
|
||||
message.entries = object.entries?.map((e) => RatingLeaderboardEntryV2.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseRatingLeaderboardEntryV2(): RatingLeaderboardEntryV2 {
|
||||
return { id: 0, score: 0, battles: 0, wins: 0, survived: 0, damage: 0, kills: 0 };
|
||||
}
|
||||
|
||||
export const RatingLeaderboardEntryV2: MessageFns<RatingLeaderboardEntryV2> = {
|
||||
encode(message: RatingLeaderboardEntryV2, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
if (message.score !== 0) {
|
||||
writer.uint32(16).uint32(message.score);
|
||||
}
|
||||
if (message.battles !== 0) {
|
||||
writer.uint32(24).uint32(message.battles);
|
||||
}
|
||||
if (message.wins !== 0) {
|
||||
writer.uint32(32).uint32(message.wins);
|
||||
}
|
||||
if (message.survived !== 0) {
|
||||
writer.uint32(40).uint32(message.survived);
|
||||
}
|
||||
if (message.damage !== 0) {
|
||||
writer.uint32(48).uint32(message.damage);
|
||||
}
|
||||
if (message.kills !== 0) {
|
||||
writer.uint32(56).uint32(message.kills);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV2 {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseRatingLeaderboardEntryV2();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.score = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.battles = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.wins = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.survived = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 6: {
|
||||
if (tag !== 48) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.damage = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
if (tag !== 56) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.kills = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): RatingLeaderboardEntryV2 {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
score: isSet(object.score) ? globalThis.Number(object.score) : 0,
|
||||
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
||||
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
||||
survived: isSet(object.survived) ? globalThis.Number(object.survived) : 0,
|
||||
damage: isSet(object.damage) ? globalThis.Number(object.damage) : 0,
|
||||
kills: isSet(object.kills) ? globalThis.Number(object.kills) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: RatingLeaderboardEntryV2): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.score !== 0) {
|
||||
obj.score = Math.round(message.score);
|
||||
}
|
||||
if (message.battles !== 0) {
|
||||
obj.battles = Math.round(message.battles);
|
||||
}
|
||||
if (message.wins !== 0) {
|
||||
obj.wins = Math.round(message.wins);
|
||||
}
|
||||
if (message.survived !== 0) {
|
||||
obj.survived = Math.round(message.survived);
|
||||
}
|
||||
if (message.damage !== 0) {
|
||||
obj.damage = Math.round(message.damage);
|
||||
}
|
||||
if (message.kills !== 0) {
|
||||
obj.kills = Math.round(message.kills);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<RatingLeaderboardEntryV2>, I>>(base?: I): RatingLeaderboardEntryV2 {
|
||||
return RatingLeaderboardEntryV2.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboardEntryV2>, I>>(object: I): RatingLeaderboardEntryV2 {
|
||||
const message = createBaseRatingLeaderboardEntryV2();
|
||||
message.id = object.id ?? 0;
|
||||
message.score = object.score ?? 0;
|
||||
message.battles = object.battles ?? 0;
|
||||
message.wins = object.wins ?? 0;
|
||||
message.survived = object.survived ?? 0;
|
||||
message.damage = object.damage ?? 0;
|
||||
message.kills = object.kills ?? 0;
|
||||
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 };
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,378 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: reviews.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface Reviews {
|
||||
reviews: { [key: number]: Review };
|
||||
}
|
||||
|
||||
export interface Reviews_ReviewsEntry {
|
||||
key: number;
|
||||
value: Review | undefined;
|
||||
}
|
||||
|
||||
export interface Review {
|
||||
last_updated: number;
|
||||
videos: Video[];
|
||||
}
|
||||
|
||||
export interface Video {
|
||||
id: string;
|
||||
author: string;
|
||||
}
|
||||
|
||||
function createBaseReviews(): Reviews {
|
||||
return { reviews: {} };
|
||||
}
|
||||
|
||||
export const Reviews: MessageFns<Reviews> = {
|
||||
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.reviews).forEach(([key, value]: [string, Review]) => {
|
||||
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseReviews();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = Reviews_ReviewsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.reviews[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Reviews {
|
||||
return {
|
||||
reviews: isObject(object.reviews)
|
||||
? (globalThis.Object.entries(object.reviews) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Review }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Reviews): unknown {
|
||||
const obj: any = {};
|
||||
if (message.reviews) {
|
||||
const entries = globalThis.Object.entries(message.reviews) as [string, Review][];
|
||||
if (entries.length > 0) {
|
||||
obj.reviews = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.reviews[k] = Review.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Reviews>, I>>(base?: I): Reviews {
|
||||
return Reviews.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
||||
const message = createBaseReviews();
|
||||
message.reviews = (globalThis.Object.entries(object.reviews ?? {}) as [string, Review][]).reduce(
|
||||
(acc: { [key: number]: Review }, [key, value]: [string, Review]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseReviews_ReviewsEntry(): Reviews_ReviewsEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
||||
encode(message: Reviews_ReviewsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Review.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews_ReviewsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseReviews_ReviewsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Review.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Reviews_ReviewsEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Review.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Reviews_ReviewsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Review.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Reviews_ReviewsEntry>, I>>(base?: I): Reviews_ReviewsEntry {
|
||||
return Reviews_ReviewsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Reviews_ReviewsEntry>, I>>(object: I): Reviews_ReviewsEntry {
|
||||
const message = createBaseReviews_ReviewsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Review.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseReview(): Review {
|
||||
return { last_updated: 0, videos: [] };
|
||||
}
|
||||
|
||||
export const Review: MessageFns<Review> = {
|
||||
encode(message: Review, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.last_updated !== 0) {
|
||||
writer.uint32(13).float(message.last_updated);
|
||||
}
|
||||
for (const v of message.videos) {
|
||||
Video.encode(v!, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Review {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseReview();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 13) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.last_updated = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.videos.push(Video.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Review {
|
||||
return {
|
||||
last_updated: isSet(object.lastUpdated)
|
||||
? globalThis.Number(object.lastUpdated)
|
||||
: isSet(object.last_updated)
|
||||
? globalThis.Number(object.last_updated)
|
||||
: 0,
|
||||
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Review): unknown {
|
||||
const obj: any = {};
|
||||
if (message.last_updated !== 0) {
|
||||
obj.lastUpdated = message.last_updated;
|
||||
}
|
||||
if (message.videos?.length) {
|
||||
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Review>, I>>(base?: I): Review {
|
||||
return Review.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Review>, I>>(object: I): Review {
|
||||
const message = createBaseReview();
|
||||
message.last_updated = object.last_updated ?? 0;
|
||||
message.videos = object.videos?.map((e) => Video.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseVideo(): Video {
|
||||
return { id: "", author: "" };
|
||||
}
|
||||
|
||||
export const Video: MessageFns<Video> = {
|
||||
encode(message: Video, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.author !== "") {
|
||||
writer.uint32(18).string(message.author);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Video {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseVideo();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.author = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Video {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
||||
author: isSet(object.author) ? globalThis.String(object.author) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Video): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== "") {
|
||||
obj.id = message.id;
|
||||
}
|
||||
if (message.author !== "") {
|
||||
obj.author = message.author;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Video>, I>>(base?: I): Video {
|
||||
return Video.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Video>, I>>(object: I): Video {
|
||||
const message = createBaseVideo();
|
||||
message.id = object.id ?? "";
|
||||
message.author = object.author ?? "";
|
||||
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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,277 +0,0 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.2
|
||||
// protoc v5.28.2
|
||||
// source: skill_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface SkillDefinitions {
|
||||
/** enums are disallowed as keys so using uint32; convert run-time */
|
||||
classes: { [key: number]: Skill };
|
||||
}
|
||||
|
||||
export interface SkillDefinitions_ClassesEntry {
|
||||
key: number;
|
||||
value: Skill | undefined;
|
||||
}
|
||||
|
||||
export interface Skill {
|
||||
skills: string[];
|
||||
}
|
||||
|
||||
function createBaseSkillDefinitions(): SkillDefinitions {
|
||||
return { classes: {} };
|
||||
}
|
||||
|
||||
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
||||
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
globalThis.Object.entries(message.classes).forEach(([key, value]: [string, Skill]) => {
|
||||
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSkillDefinitions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = SkillDefinitions_ClassesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.classes[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): SkillDefinitions {
|
||||
return {
|
||||
classes: isObject(object.classes)
|
||||
? (globalThis.Object.entries(object.classes) as [string, any][]).reduce(
|
||||
(acc: { [key: number]: Skill }, [key, value]: [string, any]) => {
|
||||
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: SkillDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.classes) {
|
||||
const entries = globalThis.Object.entries(message.classes) as [string, Skill][];
|
||||
if (entries.length > 0) {
|
||||
obj.classes = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.classes[k] = Skill.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<SkillDefinitions>, I>>(base?: I): SkillDefinitions {
|
||||
return SkillDefinitions.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
||||
const message = createBaseSkillDefinitions();
|
||||
message.classes = (globalThis.Object.entries(object.classes ?? {}) as [string, Skill][]).reduce(
|
||||
(acc: { [key: number]: Skill }, [key, value]: [string, Skill]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseSkillDefinitions_ClassesEntry(): SkillDefinitions_ClassesEntry {
|
||||
return { key: 0, value: undefined };
|
||||
}
|
||||
|
||||
export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesEntry> = {
|
||||
encode(message: SkillDefinitions_ClassesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Skill.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions_ClassesEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Skill.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): SkillDefinitions_ClassesEntry {
|
||||
return {
|
||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||
value: isSet(object.value) ? Skill.fromJSON(object.value) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: SkillDefinitions_ClassesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== 0) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Skill.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<SkillDefinitions_ClassesEntry>, I>>(base?: I): SkillDefinitions_ClassesEntry {
|
||||
return SkillDefinitions_ClassesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<SkillDefinitions_ClassesEntry>, I>>(
|
||||
object: I,
|
||||
): SkillDefinitions_ClassesEntry {
|
||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null) ? Skill.fromPartial(object.value) : undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseSkill(): Skill {
|
||||
return { skills: [] };
|
||||
}
|
||||
|
||||
export const Skill: MessageFns<Skill> = {
|
||||
encode(message: Skill, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
for (const v of message.skills) {
|
||||
writer.uint32(10).string(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Skill {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseSkill();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.skills.push(reader.string());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Skill {
|
||||
return {
|
||||
skills: globalThis.Array.isArray(object?.skills) ? object.skills.map((e: any) => globalThis.String(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Skill): unknown {
|
||||
const obj: any = {};
|
||||
if (message.skills?.length) {
|
||||
obj.skills = message.skills;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Skill>, I>>(base?: I): Skill {
|
||||
return Skill.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Skill>, I>>(object: I): Skill {
|
||||
const message = createBaseSkill();
|
||||
message.skills = object.skills?.map((e) => 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 };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Whitespace-only changes.
@@ -1,77 +1,43 @@
|
||||
import { exec as execSync } from "child_process";
|
||||
import { existsSync } from "fs";
|
||||
import { readdir, rm } from "fs/promises";
|
||||
import { promisify } from "util";
|
||||
import { execFile } from "child_process";
|
||||
import { mkdir, readdir, rm, writeFile } from "fs/promises";
|
||||
|
||||
const MAX_COMMAND_LENGTH = 2 ** 11;
|
||||
const TS_PROTO_EXECUTABLE_LOCATIONS = [
|
||||
"./node_modules/.bin/protoc-gen-ts_proto",
|
||||
"../../node_modules/.bin/protoc-gen-ts_proto",
|
||||
];
|
||||
const TEMP = "../../temp";
|
||||
const TS_PROTO_EXECUTABLE = "./node_modules/.bin/protoc-gen-ts_proto";
|
||||
const ROOTS = ["../protos/src/blitzkit"];
|
||||
|
||||
const roots = [
|
||||
"../../packages/core/src/protos",
|
||||
"../../packages/closed/protos",
|
||||
];
|
||||
for (const root of ROOTS) {
|
||||
await mkdir(TEMP, { recursive: true });
|
||||
|
||||
const exec = promisify(execSync);
|
||||
let args = "";
|
||||
|
||||
let tsProtoExecutableLocation: string | undefined = undefined;
|
||||
args += `--plugin=${TS_PROTO_EXECUTABLE}\n`;
|
||||
args += "--ts_proto_opt=esModuleInterop=true\n";
|
||||
args += "--ts_proto_opt=oneof=unions-value\n";
|
||||
args += "--ts_proto_opt=unrecognizedEnum=false\n";
|
||||
args += "--ts_proto_opt=snakeToCamel=false\n";
|
||||
args += `--ts_proto_out=${root}\n`;
|
||||
|
||||
for (const location of TS_PROTO_EXECUTABLE_LOCATIONS) {
|
||||
if (existsSync(location)) {
|
||||
tsProtoExecutableLocation = location;
|
||||
break;
|
||||
} else if (existsSync(`${location}.exe`)) {
|
||||
tsProtoExecutableLocation = `${location}.exe`;
|
||||
break;
|
||||
for (const dir of await readdir(root)) {
|
||||
args += `-I=${root}/${dir}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
if (!tsProtoExecutableLocation) {
|
||||
throw new Error(
|
||||
`Could not find ts-proto executable. Checked locations: ${TS_PROTO_EXECUTABLE_LOCATIONS.join(
|
||||
", ",
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
|
||||
for (const root of roots) {
|
||||
const filesRaw = await readdir(`${root}`);
|
||||
const filesRaw = await readdir(`${root}`, { recursive: true });
|
||||
const files: string[] = [];
|
||||
|
||||
for (const file of filesRaw) {
|
||||
if (file.endsWith(".proto")) files.push(file);
|
||||
if (file.endsWith(".proto")) {
|
||||
files.push(file);
|
||||
args += `${root}/${file}\n`;
|
||||
}
|
||||
|
||||
if (file.endsWith(".ts")) await rm(`${root}/${file}`);
|
||||
}
|
||||
|
||||
while (files.length > 0) {
|
||||
let command = [
|
||||
"protoc",
|
||||
`--plugin=${tsProtoExecutableLocation}`,
|
||||
"--ts_proto_opt=esModuleInterop=true",
|
||||
"--ts_proto_opt=oneof=unions-value",
|
||||
// "--ts_proto_opt=removeEnumPrefix=true",
|
||||
"--ts_proto_opt=unrecognizedEnum=false",
|
||||
"--ts_proto_opt=snakeToCamel=false",
|
||||
`--ts_proto_out=${root}`,
|
||||
`-I=${root}`,
|
||||
].join(" ");
|
||||
await writeFile(`${TEMP}/protoc.txt`, args);
|
||||
|
||||
while (true) {
|
||||
if (files.length === 0) break;
|
||||
|
||||
const file = files.at(-1);
|
||||
const newLine = ` ${root}/${file}`;
|
||||
|
||||
if (command.length + newLine.length < MAX_COMMAND_LENGTH) {
|
||||
command += newLine;
|
||||
files.pop();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await exec(command);
|
||||
}
|
||||
execFile("protoc", [`@${TEMP}/protoc.txt`], (error, stdout, stderr) => {
|
||||
if (error) throw new Error(error.message);
|
||||
if (stderr) console.error(stderr);
|
||||
if (stdout) console.log(stdout);
|
||||
});
|
||||
}
|
||||
@@ -1,10 +1,20 @@
|
||||
import { ConsumableDefinitions } from "@blitzkit/core";
|
||||
import { api } from "../../../blitzkit/api";
|
||||
import { vfs } from "../../../core/blitzkit/vfs";
|
||||
|
||||
export { getStaticPaths } from "../_index";
|
||||
|
||||
export async function GET() {
|
||||
const test = await vfs.xml(
|
||||
"Data/XML/item_defs/vehicles/common/consumables/common.xml",
|
||||
);
|
||||
|
||||
return Response.json(test);
|
||||
|
||||
const definitions = await api.consumables();
|
||||
|
||||
return Response.json(definitions);
|
||||
|
||||
const bytes = ConsumableDefinitions.encode(definitions).finish();
|
||||
|
||||
return new Response(bytes);
|
||||
|
||||
Reference in new issue
Block a user