move protos

This commit is contained in:
tresabhi committed 2026-09-13 12:36:29 -05:00
1 parent 5b4ad95a14
commit 054f33a649
47 files changed
+52 -11846

No files matched your search

+1 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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>();
+1 -1
View File
@@ -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 -1
View File
@@ -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,47 +0,0 @@
syntax = "proto2";
package blitzkit;
message AverageDefinitions {
map<uint32, AverageDefinitionsEntry> averages = 1;
required Samples samples = 2;
required uint64 time = 3;
}
message AverageDefinitionsEntry {
required AverageDefinitionsAllStats mu = 1;
required AverageDefinitionsAllStats sigma = 2;
required AverageDefinitionsAllStats r = 3;
required Samples samples = 4;
}
message AverageDefinitionsAllStats {
required float battles = 1;
required float capture_points = 2;
required float damage_dealt = 3;
required float damage_received = 4;
required float dropped_capture_points = 5;
required float frags = 6;
required float frags8p = 7;
required float hits = 8;
required float losses = 9;
required float max_frags = 10;
required float max_xp = 11;
required float shots = 12;
required float spotted = 13;
required float survived_battles = 14;
required float win_and_survived = 15;
required float wins = 16;
required float xp = 17;
required float battle_life_time = 18;
}
message Samples {
required uint32 d_1 = 1;
required uint32 d_7 = 2;
required uint32 d_30 = 3;
required uint32 d_60 = 4;
required uint32 d_90 = 5;
required uint32 d_120 = 6;
required uint32 total = 7;
}
@@ -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,16 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message CamouflageDefinitions {
map<uint32, Camouflage> camouflages = 1;
}
message Camouflage {
required uint32 id = 1;
required I18nString name = 2;
optional I18nString tank_name = 3;
optional I18nString tank_name_full = 4;
}
@@ -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,49 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message ConsumableDefinitions {
map<uint32, Consumable> consumables = 1;
}
message Consumable {
required uint32 id = 1;
required I18nString name = 2;
required uint32 cooldown = 3;
optional float duration = 4;
required bool game_mode_exclusive = 5;
repeated ConsumableTankFilter include = 6;
repeated ConsumableTankFilter exclude = 7;
}
message ConsumableTankFilter {
oneof filter_type {
ConsumableTankTierFilter tiers = 1;
ConsumableTankIdsFilter ids = 2;
ConsumableTankCategoryFilter categories = 3;
ConsumableTankNationFilter nations = 4;
}
}
message ConsumableTankTierFilter {
required uint32 min = 1;
required uint32 max = 2;
}
message ConsumableTankIdsFilter {
repeated uint32 ids = 1;
}
message ConsumableTankCategoryFilter {
repeated ConsumableTankCategoryFilterCategory categories = 1;
}
enum ConsumableTankCategoryFilterCategory {
CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP = 0;
}
message ConsumableTankNationFilter {
repeated string nations = 1;
}
@@ -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,24 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message EquipmentDefinitions {
map<string, EquipmentPreset> presets = 1;
map<uint32, Equipment> equipments = 2;
}
message Equipment {
required I18nString name = 1;
required I18nString description = 2;
}
message EquipmentPreset {
repeated EquipmentSlot slots = 1;
}
message EquipmentSlot {
required uint32 left = 1;
required uint32 right = 2;
}
@@ -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;
}
-15
View File
@@ -1,15 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message Gallery {
repeated Avatar avatars = 1;
}
message Avatar {
required string id = 1;
required I18nString name = 2;
required string extension = 3;
}
-201
View File
@@ -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,21 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message GameDefinitions {
required string version = 1;
repeated string nations = 2;
map<uint32, GameMode> gameModes = 3;
map<uint32, GameModeRole> roles = 4;
}
message GameMode {
required I18nString name = 1;
}
message GameModeRole {
repeated uint32 provisions = 1;
repeated uint32 consumables = 2;
}
@@ -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;
}
-7
View File
@@ -1,7 +0,0 @@
syntax = "proto2";
package blitzkit;
message I18nString {
map<string, string> locales = 1;
}
-210
View File
@@ -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;
}
-16
View File
@@ -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,14 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message MapDefinitions {
map<int32, MapDefinition> maps = 1;
}
message MapDefinition {
required uint32 id = 1;
required I18nString name = 2;
}
-296
View File
@@ -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;
}
@@ -1,79 +0,0 @@
syntax = "proto2";
package blitzkit;
message ModelDefinitions {
map<uint32, ModelDefinition> models = 1;
}
message ModelDefinition {
required Armor armor = 1;
required Vector3 turret_origin = 2;
optional InitialTurretRotation initial_turret_rotation = 3;
map<uint32, TurretModelDefinition> turrets = 4;
map<uint32, TrackModelDefinition> tracks = 5;
required BoundingBox bounding_box = 6;
}
message Armor {
map<uint32, float> thickness = 1;
repeated uint32 spaced = 2;
}
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
message InitialTurretRotation {
required float yaw = 1;
required float pitch = 2;
required float roll = 3;
}
message TurretModelDefinition {
required BoundingBox bounding_box = 1;
required Armor armor = 2;
required uint32 model_id = 3;
required Vector3 gun_origin = 4;
map<uint32, GunModelDefinition> guns = 5;
optional YawLimits yaw = 6;
}
message YawLimits {
required float min = 1;
required float max = 2;
}
message BoundingBox {
required Vector3 min = 1;
required Vector3 max = 2;
}
message TrackModelDefinition {
required float thickness = 1;
required Vector3 origin = 2;
}
message GunModelDefinition {
required Armor armor = 1;
required float thickness = 2;
required uint32 model_id = 3;
required PitchLimits pitch = 4;
optional float mask = 5;
}
message PitchLimits {
required float min = 1;
required float max = 2;
optional PitchLimitsExtrema front = 3;
optional PitchLimitsExtrema back = 4;
optional float transition = 5;
}
message PitchLimitsExtrema {
required float min = 1;
required float max = 2;
required float range = 3;
}
File diff suppressed because it is too large. Load diff
@@ -1,12 +0,0 @@
syntax = "proto2";
package blitzkit;
message PopularTanks {
repeated PopularTank tanks = 1;
}
message PopularTank {
required uint32 id = 1;
required uint32 views = 2; // views in the last 7 days
}
-182
View File
@@ -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,19 +0,0 @@
syntax = "proto2";
package blitzkit;
import "consumable_definitions.proto";
import "i18n.proto";
message ProvisionDefinitions {
map<uint32, Provision> provisions = 1;
}
message Provision {
required uint32 id = 1;
required I18nString name = 2;
optional float crew = 3;
required bool game_mode_exclusive = 5;
repeated ConsumableTankFilter include = 6;
repeated ConsumableTankFilter exclude = 7;
}
@@ -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,33 +0,0 @@
syntax = "proto2";
package blitzkit;
message RatingLeaderboard {
oneof version {
RatingLeaderboardV1 v1 = 1;
RatingLeaderboardV2 v2 = 2;
}
}
message RatingLeaderboardV1 {
repeated RatingLeaderboardEntryV1 entries = 1;
}
message RatingLeaderboardEntryV1 {
required uint32 id = 1;
required uint32 score = 2;
}
message RatingLeaderboardV2 {
repeated RatingLeaderboardEntryV2 entries = 1;
}
message RatingLeaderboardEntryV2 {
required uint32 id = 1;
required uint32 score = 2;
required uint32 battles = 3;
required uint32 wins = 4;
required uint32 survived = 5;
required uint32 damage = 6;
required uint32 kills = 7;
}
@@ -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;
}
-17
View File
@@ -1,17 +0,0 @@
syntax = "proto2";
package blitzkit;
message Reviews {
map<uint32, Review> reviews = 1;
}
message Review {
required float last_updated = 1;
repeated Video videos = 2;
}
message Video {
required string id = 1;
required string author = 2;
}
-378
View File
@@ -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,12 +0,0 @@
syntax = "proto2";
package blitzkit;
message SkillDefinitions {
// enums are disallowed as keys so using uint32; convert run-time
map<uint32, Skill> classes = 1;
}
message Skill {
repeated string skills = 1;
}
@@ -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;
}
@@ -1,244 +0,0 @@
syntax = "proto2";
package blitzkit;
import "i18n.proto";
message TankDefinitions {
map<uint32, TankDefinition> tanks = 1;
}
message TankDefinition {
required uint32 id = 1;
required string slug = 2;
map<uint32, uint32> roles = 3;
required bool fixed_camouflage = 5;
repeated int32 camouflages = 6;
repeated int32 ancestors = 7;
repeated int32 successors = 8;
repeated Crew crew = 9;
required uint32 health = 10;
required string nation = 11;
required I18nString name = 12;
required TankType type = 13;
required uint32 max_consumables = 14;
required uint32 max_provisions = 15;
required uint32 tier = 16;
required TankClass class = 17;
required bool testing = 18;
required bool deprecated = 19;
repeated TurretDefinition turrets = 20;
repeated EngineDefinition engines = 21;
repeated TrackDefinition tracks = 22;
required TankPrice price = 23;
optional ResearchCost research_cost = 24;
required float speed_forwards = 25;
required float speed_backwards = 26;
required float camouflage_still = 27;
required float camouflage_moving = 28;
required float camouflage_on_fire = 29;
required string equipment_preset = 30;
required uint32 weight = 31;
required string dev_name = 32;
optional Equalizer equalizer = 33;
}
message Equalizer {
required float health = 1;
required float penetration = 2;
required float module_health = 3;
required float damage = 4;
required float armor = 5;
}
message ResearchCost {
oneof research_cost_type {
uint32 xp = 1;
ResearchCostSeasonalTokens seasonal_tokens = 2;
}
}
message ResearchCostSeasonalTokens {
required uint32 season = 1;
required uint32 tokens = 2;
}
enum TankPriceType {
TANK_PRICE_TYPE_CREDITS = 0;
TANK_PRICE_TYPE_GOLD = 1;
}
message TankPrice {
required TankPriceType type = 1;
required uint32 value = 2;
}
message TrackDefinition {
required uint32 id = 1;
required uint32 tier = 2;
required I18nString name = 3;
required uint32 weight = 4;
required float traverse_speed = 5;
optional ResearchCost research_cost = 6;
required float dispersion_move = 7;
required float dispersion_traverse = 8;
required float resistance_hard = 9;
required float resistance_medium = 10;
required float resistance_soft = 11;
repeated Unlock unlocks = 12;
}
message EngineDefinition {
required uint32 id = 1;
required I18nString name = 2;
optional ResearchCost research_cost = 3;
required uint32 tier = 4;
required float fire_chance = 5;
required uint32 power = 6;
required uint32 weight = 7;
repeated Unlock unlocks = 8;
}
message TurretDefinition {
required uint32 id = 1;
required uint32 health = 2;
required uint32 view_range = 3;
required float traverse_speed = 4;
optional ResearchCost research_cost = 5;
required I18nString name = 6;
required uint32 tier = 7;
required uint32 weight = 8;
repeated GunDefinition guns = 9;
repeated Unlock unlocks = 10;
}
message GunDefinition {
oneof gun_type {
GunDefinitionRegular regular = 1;
GunDefinitionAutoLoader auto_loader = 2;
GunDefinitionAutoReloader auto_reloader = 3;
}
required uint32 id = 4;
required float rotation_speed = 5;
optional ResearchCost research_cost = 6;
required uint32 weight = 7;
required I18nString name = 8;
required uint32 tier = 9;
repeated ShellDefinition shells = 10;
required float camouflage_loss = 11;
required float aim_time = 12;
required float dispersion_base = 13;
required float dispersion_traverse = 14;
required float dispersion_shot = 15;
required float dispersion_damaged = 16;
repeated Unlock unlocks = 17;
required uint32 shell_capacity = 18;
optional AssaultRanges assault_ranges = 19;
optional Burst burst = 20;
}
message GunDefinitionRegular {
required float reload = 1;
}
message GunDefinitionAutoLoader {
required float clip_reload = 1;
required float intra_clip = 2;
required float shell_count = 3;
}
message Burst {
required uint32 count = 1;
required float interval = 2;
}
message GunDefinitionAutoReloader {
repeated float shell_reloads = 1;
required float intra_clip = 2;
required float shell_count = 3;
}
message AssaultRanges {
repeated AssaultRange ranges = 1;
repeated ShellType types = 2;
}
message AssaultRange {
required float distance = 1;
required float factor = 2;
}
message ShellDefinition {
required uint32 id = 1;
required I18nString name = 2;
required uint32 velocity = 3;
required uint32 armor_damage = 4;
required uint32 module_damage = 5;
required float caliber = 6;
required string icon = 7;
required ShellPenetration penetration = 8;
required ShellType type = 9;
optional float normalization = 10;
optional float ricochet = 11;
optional float explosion_radius = 12;
required uint32 range = 13;
}
enum ShellType {
SHELL_TYPE_AP = 0;
SHELL_TYPE_APCR = 1;
SHELL_TYPE_HEAT = 2;
SHELL_TYPE_HE = 3;
}
message ShellPenetration {
required float near = 1;
required float far = 2;
}
message Unlock {
required int32 id = 1;
required ModuleType type = 2;
required UnlockCost cost = 3;
}
message UnlockCost {
required string type = 1;
required int32 value = 2;
}
enum ModuleType {
MODULE_TYPE_VEHICLE = 0;
MODULE_TYPE_ENGINE = 1;
MODULE_TYPE_TRACKS = 2;
MODULE_TYPE_TURRET = 3;
MODULE_TYPE_GUN = 4;
}
enum TankClass {
TANK_CLASS_LIGHT = 0;
TANK_CLASS_MEDIUM = 1;
TANK_CLASS_HEAVY = 2;
TANK_CLASS_TANK_DESTROYER = 3;
}
enum TankType {
TANK_TYPE_RESEARCHABLE = 0;
TANK_TYPE_PREMIUM = 1;
TANK_TYPE_COLLECTOR = 2;
}
message Crew {
required CrewType type = 1;
required uint32 count = 2;
repeated CrewType substitute = 3;
}
enum CrewType {
CREW_TYPE_COMMANDER = 0;
CREW_TYPE_RADIOMAN = 1;
CREW_TYPE_GUNNER = 2;
CREW_TYPE_DRIVER = 3;
CREW_TYPE_LOADER = 4;
}
File diff suppressed because it is too large. Load diff