mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: comments
This commit is contained in:
1 parent
9fb4607bba
commit
cc3aa976db
12 files changed
+2094
-859
No files matched your search
@@ -5,10 +5,10 @@
|
|||||||
// source: packages/core/src/protos/legacy_camouflage_definitions.proto
|
// source: packages/core/src/protos/legacy_camouflage_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface CamouflageDefinitions {
|
export interface CamouflageDefinitions {
|
||||||
camouflages: { [key: number]: Camouflage };
|
camouflages: { [key: number]: Camouflage };
|
||||||
@@ -31,15 +31,25 @@ function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||||
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: CamouflageDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.camouflages).forEach(([key, value]) => {
|
Object.entries(message.camouflages).forEach(([key, value]) => {
|
||||||
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
CamouflageDefinitions_CamouflagesEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): CamouflageDefinitions {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -50,7 +60,10 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
|
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.camouflages[entry1.key] = entry1.value;
|
message.camouflages[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -68,7 +81,9 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
fromJSON(object: any): CamouflageDefinitions {
|
fromJSON(object: any): CamouflageDefinitions {
|
||||||
return {
|
return {
|
||||||
camouflages: isObject(object.camouflages)
|
camouflages: isObject(object.camouflages)
|
||||||
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
|
? Object.entries(object.camouflages).reduce<{
|
||||||
|
[key: number]: Camouflage;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
@@ -90,20 +105,23 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
|
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): CamouflageDefinitions {
|
||||||
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): CamouflageDefinitions {
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
|
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: number]: Camouflage;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -112,8 +130,12 @@ function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitio
|
|||||||
return { key: 0, value: createBaseCamouflage() };
|
return { key: 0, value: createBaseCamouflage() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
|
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
|
||||||
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: CamouflageDefinitions_CamouflagesEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -123,8 +145,12 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -157,8 +183,15 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
|
|
||||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("CamouflageDefinitions_CamouflagesEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: Camouflage.fromJSON(assertSet("CamouflageDefinitions_CamouflagesEntry.value", object.value)),
|
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: Camouflage.fromJSON(
|
||||||
|
assertSet(
|
||||||
|
'CamouflageDefinitions_CamouflagesEntry.value',
|
||||||
|
object.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -173,29 +206,40 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
create<
|
||||||
base?: I,
|
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||||
): CamouflageDefinitions_CamouflagesEntry {
|
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
|
||||||
|
base ?? ({} as any),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||||
): CamouflageDefinitions_CamouflagesEntry {
|
>(object: I): CamouflageDefinitions_CamouflagesEntry {
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? Camouflage.fromPartial(object.value)
|
? Camouflage.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseCamouflage(): Camouflage {
|
function createBaseCamouflage(): Camouflage {
|
||||||
return { id: 0, name: createBaseI18nString(), tank_name: undefined, tank_name_full: undefined };
|
return {
|
||||||
|
id: 0,
|
||||||
|
name: createBaseI18nString(),
|
||||||
|
tank_name: undefined,
|
||||||
|
tank_name_full: undefined,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Camouflage: MessageFns<Camouflage> = {
|
export const Camouflage: MessageFns<Camouflage> = {
|
||||||
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: Camouflage,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -206,13 +250,17 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
||||||
}
|
}
|
||||||
if (message.tank_name_full !== undefined) {
|
if (message.tank_name_full !== undefined) {
|
||||||
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
|
I18nString.encode(
|
||||||
|
message.tank_name_full,
|
||||||
|
writer.uint32(34).fork(),
|
||||||
|
).join();
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -261,10 +309,14 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Camouflage {
|
fromJSON(object: any): Camouflage {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Camouflage.id", object.id)),
|
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
|
||||||
name: I18nString.fromJSON(assertSet("Camouflage.name", object.name)),
|
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
|
||||||
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
|
tank_name: isSet(object.tank_name)
|
||||||
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
|
? I18nString.fromJSON(object.tank_name)
|
||||||
|
: undefined,
|
||||||
|
tank_name_full: isSet(object.tank_name_full)
|
||||||
|
? I18nString.fromJSON(object.tank_name_full)
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -288,37 +340,57 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
||||||
return Camouflage.fromPartial(base ?? ({} as any));
|
return Camouflage.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
|
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
|
||||||
|
object: I,
|
||||||
|
): Camouflage {
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
message.tank_name =
|
||||||
|
object.tank_name !== undefined && object.tank_name !== null
|
||||||
? I18nString.fromPartial(object.tank_name)
|
? I18nString.fromPartial(object.tank_name)
|
||||||
: undefined;
|
: undefined;
|
||||||
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
message.tank_name_full =
|
||||||
|
object.tank_name_full !== undefined && object.tank_name_full !== null
|
||||||
? I18nString.fromPartial(object.tank_name_full)
|
? I18nString.fromPartial(object.tank_name_full)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -5,34 +5,42 @@
|
|||||||
// source: packages/core/src/protos/legacy_consumable_definitions.proto
|
// source: packages/core/src/protos/legacy_consumable_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export enum ConsumableTankCategoryFilterCategory {
|
export enum ConsumableTankCategoryFilterCategory {
|
||||||
CLIP = 0,
|
CLIP = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
|
export function consumableTankCategoryFilterCategoryFromJSON(
|
||||||
|
object: any,
|
||||||
|
): ConsumableTankCategoryFilterCategory {
|
||||||
switch (object) {
|
switch (object) {
|
||||||
case 0:
|
case 0:
|
||||||
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
|
case 'CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP':
|
||||||
return ConsumableTankCategoryFilterCategory.CLIP;
|
return ConsumableTankCategoryFilterCategory.CLIP;
|
||||||
default:
|
default:
|
||||||
throw new globalThis.Error(
|
throw new globalThis.Error(
|
||||||
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
'Unrecognized enum value ' +
|
||||||
|
object +
|
||||||
|
' for enum ConsumableTankCategoryFilterCategory',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
|
export function consumableTankCategoryFilterCategoryToJSON(
|
||||||
|
object: ConsumableTankCategoryFilterCategory,
|
||||||
|
): string {
|
||||||
switch (object) {
|
switch (object) {
|
||||||
case ConsumableTankCategoryFilterCategory.CLIP:
|
case ConsumableTankCategoryFilterCategory.CLIP:
|
||||||
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
|
return 'CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP';
|
||||||
default:
|
default:
|
||||||
throw new globalThis.Error(
|
throw new globalThis.Error(
|
||||||
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
'Unrecognized enum value ' +
|
||||||
|
object +
|
||||||
|
' for enum ConsumableTankCategoryFilterCategory',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,10 +66,10 @@ export interface Consumable {
|
|||||||
|
|
||||||
export interface ConsumableTankFilter {
|
export interface ConsumableTankFilter {
|
||||||
filter_type?:
|
filter_type?:
|
||||||
| { $case: "tiers"; value: ConsumableTankTierFilter }
|
| { $case: 'tiers'; value: ConsumableTankTierFilter }
|
||||||
| { $case: "ids"; value: ConsumableTankIdsFilter }
|
| { $case: 'ids'; value: ConsumableTankIdsFilter }
|
||||||
| { $case: "categories"; value: ConsumableTankCategoryFilter }
|
| { $case: 'categories'; value: ConsumableTankCategoryFilter }
|
||||||
| { $case: "nations"; value: ConsumableTankNationFilter }
|
| { $case: 'nations'; value: ConsumableTankNationFilter }
|
||||||
| undefined;
|
| undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,15 +95,25 @@ function createBaseConsumableDefinitions(): ConsumableDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
||||||
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: ConsumableDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.consumables).forEach(([key, value]) => {
|
Object.entries(message.consumables).forEach(([key, value]) => {
|
||||||
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ConsumableDefinitions_ConsumablesEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableDefinitions {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableDefinitions();
|
const message = createBaseConsumableDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -106,7 +124,10 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = ConsumableDefinitions_ConsumablesEntry.decode(reader, reader.uint32());
|
const entry1 = ConsumableDefinitions_ConsumablesEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.consumables[entry1.key] = entry1.value;
|
message.consumables[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -124,7 +145,9 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
fromJSON(object: any): ConsumableDefinitions {
|
fromJSON(object: any): ConsumableDefinitions {
|
||||||
return {
|
return {
|
||||||
consumables: isObject(object.consumables)
|
consumables: isObject(object.consumables)
|
||||||
? Object.entries(object.consumables).reduce<{ [key: number]: Consumable }>((acc, [key, value]) => {
|
? Object.entries(object.consumables).reduce<{
|
||||||
|
[key: number]: Consumable;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
@@ -146,20 +169,23 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(base?: I): ConsumableDefinitions {
|
create<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableDefinitions {
|
||||||
return ConsumableDefinitions.fromPartial(base ?? ({} as any));
|
return ConsumableDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableDefinitions {
|
||||||
const message = createBaseConsumableDefinitions();
|
const message = createBaseConsumableDefinitions();
|
||||||
message.consumables = Object.entries(object.consumables ?? {}).reduce<{ [key: number]: Consumable }>(
|
message.consumables = Object.entries(object.consumables ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: number]: Consumable;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -168,8 +194,12 @@ function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitio
|
|||||||
return { key: 0, value: createBaseConsumable() };
|
return { key: 0, value: createBaseConsumable() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
|
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> =
|
||||||
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: ConsumableDefinitions_ConsumablesEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -179,8 +209,12 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableDefinitions_ConsumablesEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -213,8 +247,15 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
|
|
||||||
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
|
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("ConsumableDefinitions_ConsumablesEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: Consumable.fromJSON(assertSet("ConsumableDefinitions_ConsumablesEntry.value", object.value)),
|
assertSet('ConsumableDefinitions_ConsumablesEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: Consumable.fromJSON(
|
||||||
|
assertSet(
|
||||||
|
'ConsumableDefinitions_ConsumablesEntry.value',
|
||||||
|
object.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -229,22 +270,25 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
|
create<
|
||||||
base?: I,
|
I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>,
|
||||||
): ConsumableDefinitions_ConsumablesEntry {
|
>(base?: I): ConsumableDefinitions_ConsumablesEntry {
|
||||||
return ConsumableDefinitions_ConsumablesEntry.fromPartial(base ?? ({} as any));
|
return ConsumableDefinitions_ConsumablesEntry.fromPartial(
|
||||||
|
base ?? ({} as any),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>,
|
||||||
): ConsumableDefinitions_ConsumablesEntry {
|
>(object: I): ConsumableDefinitions_ConsumablesEntry {
|
||||||
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? Consumable.fromPartial(object.value)
|
? Consumable.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseConsumable(): Consumable {
|
function createBaseConsumable(): Consumable {
|
||||||
return {
|
return {
|
||||||
@@ -259,7 +303,10 @@ function createBaseConsumable(): Consumable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Consumable: MessageFns<Consumable> = {
|
export const Consumable: MessageFns<Consumable> = {
|
||||||
encode(message: Consumable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: Consumable,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -285,7 +332,8 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
|
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumable();
|
const message = createBaseConsumable();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -336,7 +384,9 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
message.include.push(
|
||||||
|
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 7: {
|
case 7: {
|
||||||
@@ -344,7 +394,9 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
message.exclude.push(
|
||||||
|
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,11 +410,17 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Consumable {
|
fromJSON(object: any): Consumable {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Consumable.id", object.id)),
|
id: globalThis.Number(assertSet('Consumable.id', object.id)),
|
||||||
name: I18nString.fromJSON(assertSet("Consumable.name", object.name)),
|
name: I18nString.fromJSON(assertSet('Consumable.name', object.name)),
|
||||||
cooldown: globalThis.Number(assertSet("Consumable.cooldown", object.cooldown)),
|
cooldown: globalThis.Number(
|
||||||
duration: isSet(object.duration) ? globalThis.Number(object.duration) : undefined,
|
assertSet('Consumable.cooldown', object.cooldown),
|
||||||
game_mode_exclusive: globalThis.Boolean(assertSet("Consumable.game_mode_exclusive", object.game_mode_exclusive)),
|
),
|
||||||
|
duration: isSet(object.duration)
|
||||||
|
? globalThis.Number(object.duration)
|
||||||
|
: undefined,
|
||||||
|
game_mode_exclusive: globalThis.Boolean(
|
||||||
|
assertSet('Consumable.game_mode_exclusive', object.game_mode_exclusive),
|
||||||
|
),
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -401,17 +459,22 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
create<I extends Exact<DeepPartial<Consumable>, I>>(base?: I): Consumable {
|
create<I extends Exact<DeepPartial<Consumable>, I>>(base?: I): Consumable {
|
||||||
return Consumable.fromPartial(base ?? ({} as any));
|
return Consumable.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Consumable>, I>>(object: I): Consumable {
|
fromPartial<I extends Exact<DeepPartial<Consumable>, I>>(
|
||||||
|
object: I,
|
||||||
|
): Consumable {
|
||||||
const message = createBaseConsumable();
|
const message = createBaseConsumable();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
message.cooldown = object.cooldown ?? 0;
|
message.cooldown = object.cooldown ?? 0;
|
||||||
message.duration = object.duration ?? undefined;
|
message.duration = object.duration ?? undefined;
|
||||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.include =
|
||||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
|
message.exclude =
|
||||||
|
object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -421,26 +484,45 @@ function createBaseConsumableTankFilter(): ConsumableTankFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
||||||
encode(message: ConsumableTankFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: ConsumableTankFilter,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
switch (message.filter_type?.$case) {
|
switch (message.filter_type?.$case) {
|
||||||
case "tiers":
|
case 'tiers':
|
||||||
ConsumableTankTierFilter.encode(message.filter_type.value, writer.uint32(10).fork()).join();
|
ConsumableTankTierFilter.encode(
|
||||||
|
message.filter_type.value,
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
break;
|
break;
|
||||||
case "ids":
|
case 'ids':
|
||||||
ConsumableTankIdsFilter.encode(message.filter_type.value, writer.uint32(18).fork()).join();
|
ConsumableTankIdsFilter.encode(
|
||||||
|
message.filter_type.value,
|
||||||
|
writer.uint32(18).fork(),
|
||||||
|
).join();
|
||||||
break;
|
break;
|
||||||
case "categories":
|
case 'categories':
|
||||||
ConsumableTankCategoryFilter.encode(message.filter_type.value, writer.uint32(26).fork()).join();
|
ConsumableTankCategoryFilter.encode(
|
||||||
|
message.filter_type.value,
|
||||||
|
writer.uint32(26).fork(),
|
||||||
|
).join();
|
||||||
break;
|
break;
|
||||||
case "nations":
|
case 'nations':
|
||||||
ConsumableTankNationFilter.encode(message.filter_type.value, writer.uint32(34).fork()).join();
|
ConsumableTankNationFilter.encode(
|
||||||
|
message.filter_type.value,
|
||||||
|
writer.uint32(34).fork(),
|
||||||
|
).join();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableTankFilter {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankFilter();
|
const message = createBaseConsumableTankFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -451,7 +533,10 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.decode(reader, reader.uint32()) };
|
message.filter_type = {
|
||||||
|
$case: 'tiers',
|
||||||
|
value: ConsumableTankTierFilter.decode(reader, reader.uint32()),
|
||||||
|
};
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
@@ -459,7 +544,10 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.decode(reader, reader.uint32()) };
|
message.filter_type = {
|
||||||
|
$case: 'ids',
|
||||||
|
value: ConsumableTankIdsFilter.decode(reader, reader.uint32()),
|
||||||
|
};
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
@@ -468,7 +556,7 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.filter_type = {
|
message.filter_type = {
|
||||||
$case: "categories",
|
$case: 'categories',
|
||||||
value: ConsumableTankCategoryFilter.decode(reader, reader.uint32()),
|
value: ConsumableTankCategoryFilter.decode(reader, reader.uint32()),
|
||||||
};
|
};
|
||||||
continue;
|
continue;
|
||||||
@@ -478,7 +566,10 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.filter_type = { $case: "nations", value: ConsumableTankNationFilter.decode(reader, reader.uint32()) };
|
message.filter_type = {
|
||||||
|
$case: 'nations',
|
||||||
|
value: ConsumableTankNationFilter.decode(reader, reader.uint32()),
|
||||||
|
};
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -493,70 +584,98 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
fromJSON(object: any): ConsumableTankFilter {
|
fromJSON(object: any): ConsumableTankFilter {
|
||||||
return {
|
return {
|
||||||
filter_type: isSet(object.tiers)
|
filter_type: isSet(object.tiers)
|
||||||
? { $case: "tiers", value: ConsumableTankTierFilter.fromJSON(object.tiers) }
|
? {
|
||||||
|
$case: 'tiers',
|
||||||
|
value: ConsumableTankTierFilter.fromJSON(object.tiers),
|
||||||
|
}
|
||||||
: isSet(object.ids)
|
: isSet(object.ids)
|
||||||
? { $case: "ids", value: ConsumableTankIdsFilter.fromJSON(object.ids) }
|
? {
|
||||||
|
$case: 'ids',
|
||||||
|
value: ConsumableTankIdsFilter.fromJSON(object.ids),
|
||||||
|
}
|
||||||
: isSet(object.categories)
|
: isSet(object.categories)
|
||||||
? { $case: "categories", value: ConsumableTankCategoryFilter.fromJSON(object.categories) }
|
? {
|
||||||
|
$case: 'categories',
|
||||||
|
value: ConsumableTankCategoryFilter.fromJSON(object.categories),
|
||||||
|
}
|
||||||
: isSet(object.nations)
|
: isSet(object.nations)
|
||||||
? { $case: "nations", value: ConsumableTankNationFilter.fromJSON(object.nations) }
|
? {
|
||||||
|
$case: 'nations',
|
||||||
|
value: ConsumableTankNationFilter.fromJSON(object.nations),
|
||||||
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: ConsumableTankFilter): unknown {
|
toJSON(message: ConsumableTankFilter): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.filter_type?.$case === "tiers") {
|
if (message.filter_type?.$case === 'tiers') {
|
||||||
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
|
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
|
||||||
}
|
}
|
||||||
if (message.filter_type?.$case === "ids") {
|
if (message.filter_type?.$case === 'ids') {
|
||||||
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
|
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
|
||||||
}
|
}
|
||||||
if (message.filter_type?.$case === "categories") {
|
if (message.filter_type?.$case === 'categories') {
|
||||||
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
|
obj.categories = ConsumableTankCategoryFilter.toJSON(
|
||||||
|
message.filter_type.value,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (message.filter_type?.$case === "nations") {
|
if (message.filter_type?.$case === 'nations') {
|
||||||
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
|
obj.nations = ConsumableTankNationFilter.toJSON(
|
||||||
|
message.filter_type.value,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(base?: I): ConsumableTankFilter {
|
create<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableTankFilter {
|
||||||
return ConsumableTankFilter.fromPartial(base ?? ({} as any));
|
return ConsumableTankFilter.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableTankFilter {
|
||||||
const message = createBaseConsumableTankFilter();
|
const message = createBaseConsumableTankFilter();
|
||||||
if (
|
if (
|
||||||
object.filter_type?.$case === "tiers" &&
|
object.filter_type?.$case === 'tiers' &&
|
||||||
object.filter_type?.value !== undefined &&
|
|
||||||
object.filter_type?.value !== null
|
|
||||||
) {
|
|
||||||
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.fromPartial(object.filter_type.value) };
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
object.filter_type?.$case === "ids" &&
|
|
||||||
object.filter_type?.value !== undefined &&
|
|
||||||
object.filter_type?.value !== null
|
|
||||||
) {
|
|
||||||
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
object.filter_type?.$case === "categories" &&
|
|
||||||
object.filter_type?.value !== undefined &&
|
object.filter_type?.value !== undefined &&
|
||||||
object.filter_type?.value !== null
|
object.filter_type?.value !== null
|
||||||
) {
|
) {
|
||||||
message.filter_type = {
|
message.filter_type = {
|
||||||
$case: "categories",
|
$case: 'tiers',
|
||||||
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
|
value: ConsumableTankTierFilter.fromPartial(object.filter_type.value),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
object.filter_type?.$case === "nations" &&
|
object.filter_type?.$case === 'ids' &&
|
||||||
object.filter_type?.value !== undefined &&
|
object.filter_type?.value !== undefined &&
|
||||||
object.filter_type?.value !== null
|
object.filter_type?.value !== null
|
||||||
) {
|
) {
|
||||||
message.filter_type = {
|
message.filter_type = {
|
||||||
$case: "nations",
|
$case: 'ids',
|
||||||
|
value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
object.filter_type?.$case === 'categories' &&
|
||||||
|
object.filter_type?.value !== undefined &&
|
||||||
|
object.filter_type?.value !== null
|
||||||
|
) {
|
||||||
|
message.filter_type = {
|
||||||
|
$case: 'categories',
|
||||||
|
value: ConsumableTankCategoryFilter.fromPartial(
|
||||||
|
object.filter_type.value,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
object.filter_type?.$case === 'nations' &&
|
||||||
|
object.filter_type?.value !== undefined &&
|
||||||
|
object.filter_type?.value !== null
|
||||||
|
) {
|
||||||
|
message.filter_type = {
|
||||||
|
$case: 'nations',
|
||||||
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -569,7 +688,10 @@ function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
||||||
encode(message: ConsumableTankTierFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: ConsumableTankTierFilter,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.min !== 0) {
|
if (message.min !== 0) {
|
||||||
writer.uint32(8).uint32(message.min);
|
writer.uint32(8).uint32(message.min);
|
||||||
}
|
}
|
||||||
@@ -579,8 +701,12 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableTankTierFilter {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankTierFilter();
|
const message = createBaseConsumableTankTierFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -613,8 +739,12 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
|
|
||||||
fromJSON(object: any): ConsumableTankTierFilter {
|
fromJSON(object: any): ConsumableTankTierFilter {
|
||||||
return {
|
return {
|
||||||
min: globalThis.Number(assertSet("ConsumableTankTierFilter.min", object.min)),
|
min: globalThis.Number(
|
||||||
max: globalThis.Number(assertSet("ConsumableTankTierFilter.max", object.max)),
|
assertSet('ConsumableTankTierFilter.min', object.min),
|
||||||
|
),
|
||||||
|
max: globalThis.Number(
|
||||||
|
assertSet('ConsumableTankTierFilter.max', object.max),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -629,10 +759,14 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(base?: I): ConsumableTankTierFilter {
|
create<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableTankTierFilter {
|
||||||
return ConsumableTankTierFilter.fromPartial(base ?? ({} as any));
|
return ConsumableTankTierFilter.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(object: I): ConsumableTankTierFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableTankTierFilter {
|
||||||
const message = createBaseConsumableTankTierFilter();
|
const message = createBaseConsumableTankTierFilter();
|
||||||
message.min = object.min ?? 0;
|
message.min = object.min ?? 0;
|
||||||
message.max = object.max ?? 0;
|
message.max = object.max ?? 0;
|
||||||
@@ -645,7 +779,10 @@ function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
||||||
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: ConsumableTankIdsFilter,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
writer.uint32(10).fork();
|
||||||
for (const v of message.ids) {
|
for (const v of message.ids) {
|
||||||
writer.uint32(v);
|
writer.uint32(v);
|
||||||
@@ -654,8 +791,12 @@ export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableTankIdsFilter {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankIdsFilter();
|
const message = createBaseConsumableTankIdsFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -689,7 +830,11 @@ export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fromJSON(object: any): ConsumableTankIdsFilter {
|
fromJSON(object: any): ConsumableTankIdsFilter {
|
||||||
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
|
return {
|
||||||
|
ids: globalThis.Array.isArray(object?.ids)
|
||||||
|
? object.ids.map((e: any) => globalThis.Number(e))
|
||||||
|
: [],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: ConsumableTankIdsFilter): unknown {
|
toJSON(message: ConsumableTankIdsFilter): unknown {
|
||||||
@@ -700,10 +845,14 @@ export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(base?: I): ConsumableTankIdsFilter {
|
create<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableTankIdsFilter {
|
||||||
return ConsumableTankIdsFilter.fromPartial(base ?? ({} as any));
|
return ConsumableTankIdsFilter.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(object: I): ConsumableTankIdsFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableTankIdsFilter {
|
||||||
const message = createBaseConsumableTankIdsFilter();
|
const message = createBaseConsumableTankIdsFilter();
|
||||||
message.ids = object.ids?.map((e) => e) || [];
|
message.ids = object.ids?.map((e) => e) || [];
|
||||||
return message;
|
return message;
|
||||||
@@ -714,8 +863,12 @@ function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter
|
|||||||
return { categories: [] };
|
return { categories: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
|
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> =
|
||||||
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: ConsumableTankCategoryFilter,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
writer.uint32(10).fork();
|
||||||
for (const v of message.categories) {
|
for (const v of message.categories) {
|
||||||
writer.int32(v);
|
writer.int32(v);
|
||||||
@@ -724,8 +877,12 @@ export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilt
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableTankCategoryFilter {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankCategoryFilter();
|
const message = createBaseConsumableTankCategoryFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -761,7 +918,9 @@ export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilt
|
|||||||
fromJSON(object: any): ConsumableTankCategoryFilter {
|
fromJSON(object: any): ConsumableTankCategoryFilter {
|
||||||
return {
|
return {
|
||||||
categories: globalThis.Array.isArray(object?.categories)
|
categories: globalThis.Array.isArray(object?.categories)
|
||||||
? object.categories.map((e: any) => consumableTankCategoryFilterCategoryFromJSON(e))
|
? object.categories.map((e: any) =>
|
||||||
|
consumableTankCategoryFilterCategoryFromJSON(e),
|
||||||
|
)
|
||||||
: [],
|
: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -769,35 +928,49 @@ export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilt
|
|||||||
toJSON(message: ConsumableTankCategoryFilter): unknown {
|
toJSON(message: ConsumableTankCategoryFilter): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.categories?.length) {
|
if (message.categories?.length) {
|
||||||
obj.categories = message.categories.map((e) => consumableTankCategoryFilterCategoryToJSON(e));
|
obj.categories = message.categories.map((e) =>
|
||||||
|
consumableTankCategoryFilterCategoryToJSON(e),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(base?: I): ConsumableTankCategoryFilter {
|
create<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableTankCategoryFilter {
|
||||||
return ConsumableTankCategoryFilter.fromPartial(base ?? ({} as any));
|
return ConsumableTankCategoryFilter.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(object: I): ConsumableTankCategoryFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableTankCategoryFilter {
|
||||||
const message = createBaseConsumableTankCategoryFilter();
|
const message = createBaseConsumableTankCategoryFilter();
|
||||||
message.categories = object.categories?.map((e) => e) || [];
|
message.categories = object.categories?.map((e) => e) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
|
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
|
||||||
return { nations: [] };
|
return { nations: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter> = {
|
export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter> =
|
||||||
encode(message: ConsumableTankNationFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: ConsumableTankNationFilter,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
for (const v of message.nations) {
|
for (const v of message.nations) {
|
||||||
writer.uint32(10).string(v!);
|
writer.uint32(10).string(v!);
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ConsumableTankNationFilter {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankNationFilter();
|
const message = createBaseConsumableTankNationFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -822,7 +995,9 @@ export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter>
|
|||||||
|
|
||||||
fromJSON(object: any): ConsumableTankNationFilter {
|
fromJSON(object: any): ConsumableTankNationFilter {
|
||||||
return {
|
return {
|
||||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
nations: globalThis.Array.isArray(object?.nations)
|
||||||
|
? object.nations.map((e: any) => globalThis.String(e))
|
||||||
|
: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -834,31 +1009,50 @@ export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter>
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(base?: I): ConsumableTankNationFilter {
|
create<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ConsumableTankNationFilter {
|
||||||
return ConsumableTankNationFilter.fromPartial(base ?? ({} as any));
|
return ConsumableTankNationFilter.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(object: I): ConsumableTankNationFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ConsumableTankNationFilter {
|
||||||
const message = createBaseConsumableTankNationFilter();
|
const message = createBaseConsumableTankNationFilter();
|
||||||
message.nations = object.nations?.map((e) => e) || [];
|
message.nations = object.nations?.map((e) => e) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
// source: packages/core/src/protos/legacy_equipment_definitions.proto
|
// source: packages/core/src/protos/legacy_equipment_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface EquipmentDefinitions {
|
export interface EquipmentDefinitions {
|
||||||
presets: { [key: string]: EquipmentPreset };
|
presets: { [key: string]: EquipmentPreset };
|
||||||
@@ -44,18 +44,31 @@ function createBaseEquipmentDefinitions(): EquipmentDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||||
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: EquipmentDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.presets).forEach(([key, value]) => {
|
Object.entries(message.presets).forEach(([key, value]) => {
|
||||||
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
EquipmentDefinitions_PresetsEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
Object.entries(message.equipments).forEach(([key, value]) => {
|
Object.entries(message.equipments).forEach(([key, value]) => {
|
||||||
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
EquipmentDefinitions_EquipmentsEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(18).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): EquipmentDefinitions {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions();
|
const message = createBaseEquipmentDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -66,7 +79,10 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = EquipmentDefinitions_PresetsEntry.decode(reader, reader.uint32());
|
const entry1 = EquipmentDefinitions_PresetsEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.presets[entry1.key] = entry1.value;
|
message.presets[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -77,7 +93,10 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(reader, reader.uint32());
|
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry2.value !== undefined) {
|
if (entry2.value !== undefined) {
|
||||||
message.equipments[entry2.key] = entry2.value;
|
message.equipments[entry2.key] = entry2.value;
|
||||||
}
|
}
|
||||||
@@ -95,13 +114,17 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
fromJSON(object: any): EquipmentDefinitions {
|
fromJSON(object: any): EquipmentDefinitions {
|
||||||
return {
|
return {
|
||||||
presets: isObject(object.presets)
|
presets: isObject(object.presets)
|
||||||
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
|
? Object.entries(object.presets).reduce<{
|
||||||
|
[key: string]: EquipmentPreset;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
acc[key] = EquipmentPreset.fromJSON(value);
|
acc[key] = EquipmentPreset.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: {},
|
: {},
|
||||||
equipments: isObject(object.equipments)
|
equipments: isObject(object.equipments)
|
||||||
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
|
? Object.entries(object.equipments).reduce<{
|
||||||
|
[key: number]: Equipment;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
@@ -132,39 +155,45 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(base?: I): EquipmentDefinitions {
|
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): EquipmentDefinitions {
|
||||||
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
|
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): EquipmentDefinitions {
|
||||||
const message = createBaseEquipmentDefinitions();
|
const message = createBaseEquipmentDefinitions();
|
||||||
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
|
message.presets = Object.entries(object.presets ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: string]: EquipmentPreset;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[key] = EquipmentPreset.fromPartial(value);
|
acc[key] = EquipmentPreset.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
message.equipments = Object.entries(object.equipments ?? {}).reduce<{
|
||||||
);
|
[key: number]: Equipment;
|
||||||
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
|
}>((acc, [key, value]) => {
|
||||||
(acc, [key, value]) => {
|
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
||||||
return { key: "", value: createBaseEquipmentPreset() };
|
return { key: '', value: createBaseEquipmentPreset() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
|
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> =
|
||||||
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: EquipmentDefinitions_PresetsEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(10).string(message.key);
|
writer.uint32(10).string(message.key);
|
||||||
}
|
}
|
||||||
@@ -174,8 +203,12 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): EquipmentDefinitions_PresetsEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -208,8 +241,12 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.String(assertSet("EquipmentDefinitions_PresetsEntry.key", object.key)),
|
key: globalThis.String(
|
||||||
value: EquipmentPreset.fromJSON(assertSet("EquipmentDefinitions_PresetsEntry.value", object.value)),
|
assertSet('EquipmentDefinitions_PresetsEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: EquipmentPreset.fromJSON(
|
||||||
|
assertSet('EquipmentDefinitions_PresetsEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -229,24 +266,29 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
): EquipmentDefinitions_PresetsEntry {
|
): EquipmentDefinitions_PresetsEntry {
|
||||||
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
|
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>,
|
||||||
): EquipmentDefinitions_PresetsEntry {
|
>(object: I): EquipmentDefinitions_PresetsEntry {
|
||||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||||
message.key = object.key ?? "";
|
message.key = object.key ?? '';
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? EquipmentPreset.fromPartial(object.value)
|
? EquipmentPreset.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
||||||
return { key: 0, value: createBaseEquipment() };
|
return { key: 0, value: createBaseEquipment() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
|
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> =
|
||||||
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: EquipmentDefinitions_EquipmentsEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -256,8 +298,12 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): EquipmentDefinitions_EquipmentsEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -290,8 +336,12 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("EquipmentDefinitions_EquipmentsEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: Equipment.fromJSON(assertSet("EquipmentDefinitions_EquipmentsEntry.value", object.value)),
|
assertSet('EquipmentDefinitions_EquipmentsEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: Equipment.fromJSON(
|
||||||
|
assertSet('EquipmentDefinitions_EquipmentsEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -306,29 +356,35 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
create<
|
||||||
base?: I,
|
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
|
||||||
): EquipmentDefinitions_EquipmentsEntry {
|
>(base?: I): EquipmentDefinitions_EquipmentsEntry {
|
||||||
return EquipmentDefinitions_EquipmentsEntry.fromPartial(base ?? ({} as any));
|
return EquipmentDefinitions_EquipmentsEntry.fromPartial(
|
||||||
|
base ?? ({} as any),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
|
||||||
): EquipmentDefinitions_EquipmentsEntry {
|
>(object: I): EquipmentDefinitions_EquipmentsEntry {
|
||||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? Equipment.fromPartial(object.value)
|
? Equipment.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseEquipment(): Equipment {
|
function createBaseEquipment(): Equipment {
|
||||||
return { name: createBaseI18nString(), description: createBaseI18nString() };
|
return { name: createBaseI18nString(), description: createBaseI18nString() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Equipment: MessageFns<Equipment> = {
|
export const Equipment: MessageFns<Equipment> = {
|
||||||
encode(message: Equipment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: Equipment,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.name !== undefined) {
|
if (message.name !== undefined) {
|
||||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||||
}
|
}
|
||||||
@@ -339,7 +395,8 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
|
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipment();
|
const message = createBaseEquipment();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -372,8 +429,10 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Equipment {
|
fromJSON(object: any): Equipment {
|
||||||
return {
|
return {
|
||||||
name: I18nString.fromJSON(assertSet("Equipment.name", object.name)),
|
name: I18nString.fromJSON(assertSet('Equipment.name', object.name)),
|
||||||
description: I18nString.fromJSON(assertSet("Equipment.description", object.description)),
|
description: I18nString.fromJSON(
|
||||||
|
assertSet('Equipment.description', object.description),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -391,12 +450,16 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
|
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
|
||||||
return Equipment.fromPartial(base ?? ({} as any));
|
return Equipment.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(object: I): Equipment {
|
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(
|
||||||
|
object: I,
|
||||||
|
): Equipment {
|
||||||
const message = createBaseEquipment();
|
const message = createBaseEquipment();
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
message.description = (object.description !== undefined && object.description !== null)
|
message.description =
|
||||||
|
object.description !== undefined && object.description !== null
|
||||||
? I18nString.fromPartial(object.description)
|
? I18nString.fromPartial(object.description)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
return message;
|
return message;
|
||||||
@@ -408,7 +471,10 @@ function createBaseEquipmentPreset(): EquipmentPreset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
||||||
encode(message: EquipmentPreset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: EquipmentPreset,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
for (const v of message.slots) {
|
for (const v of message.slots) {
|
||||||
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
|
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
|
||||||
}
|
}
|
||||||
@@ -416,7 +482,8 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentPreset();
|
const message = createBaseEquipmentPreset();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -441,7 +508,9 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentPreset {
|
fromJSON(object: any): EquipmentPreset {
|
||||||
return {
|
return {
|
||||||
slots: globalThis.Array.isArray(object?.slots) ? object.slots.map((e: any) => EquipmentSlot.fromJSON(e)) : [],
|
slots: globalThis.Array.isArray(object?.slots)
|
||||||
|
? object.slots.map((e: any) => EquipmentSlot.fromJSON(e))
|
||||||
|
: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -453,12 +522,17 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(base?: I): EquipmentPreset {
|
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): EquipmentPreset {
|
||||||
return EquipmentPreset.fromPartial(base ?? ({} as any));
|
return EquipmentPreset.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(object: I): EquipmentPreset {
|
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
|
||||||
|
object: I,
|
||||||
|
): EquipmentPreset {
|
||||||
const message = createBaseEquipmentPreset();
|
const message = createBaseEquipmentPreset();
|
||||||
message.slots = object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
|
message.slots =
|
||||||
|
object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -468,7 +542,10 @@ function createBaseEquipmentSlot(): EquipmentSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
||||||
encode(message: EquipmentSlot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: EquipmentSlot,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.left !== 0) {
|
if (message.left !== 0) {
|
||||||
writer.uint32(8).uint32(message.left);
|
writer.uint32(8).uint32(message.left);
|
||||||
}
|
}
|
||||||
@@ -479,7 +556,8 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentSlot();
|
const message = createBaseEquipmentSlot();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -512,8 +590,8 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentSlot {
|
fromJSON(object: any): EquipmentSlot {
|
||||||
return {
|
return {
|
||||||
left: globalThis.Number(assertSet("EquipmentSlot.left", object.left)),
|
left: globalThis.Number(assertSet('EquipmentSlot.left', object.left)),
|
||||||
right: globalThis.Number(assertSet("EquipmentSlot.right", object.right)),
|
right: globalThis.Number(assertSet('EquipmentSlot.right', object.right)),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -528,10 +606,14 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(base?: I): EquipmentSlot {
|
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): EquipmentSlot {
|
||||||
return EquipmentSlot.fromPartial(base ?? ({} as any));
|
return EquipmentSlot.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(object: I): EquipmentSlot {
|
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
|
||||||
|
object: I,
|
||||||
|
): EquipmentSlot {
|
||||||
const message = createBaseEquipmentSlot();
|
const message = createBaseEquipmentSlot();
|
||||||
message.left = object.left ?? 0;
|
message.left = object.left ?? 0;
|
||||||
message.right = object.right ?? 0;
|
message.right = object.right ?? 0;
|
||||||
@@ -539,21 +621,36 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
// source: packages/core/src/protos/legacy_game_definitions.proto
|
// source: packages/core/src/protos/legacy_game_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface GameDefinitions {
|
export interface GameDefinitions {
|
||||||
version: string;
|
version: string;
|
||||||
@@ -37,28 +37,38 @@ export interface GameModeRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createBaseGameDefinitions(): GameDefinitions {
|
function createBaseGameDefinitions(): GameDefinitions {
|
||||||
return { version: "", nations: [], gameModes: {}, roles: {} };
|
return { version: '', nations: [], gameModes: {}, roles: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions: MessageFns<GameDefinitions> = {
|
export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||||
encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
if (message.version !== "") {
|
message: GameDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
|
if (message.version !== '') {
|
||||||
writer.uint32(10).string(message.version);
|
writer.uint32(10).string(message.version);
|
||||||
}
|
}
|
||||||
for (const v of message.nations) {
|
for (const v of message.nations) {
|
||||||
writer.uint32(18).string(v!);
|
writer.uint32(18).string(v!);
|
||||||
}
|
}
|
||||||
Object.entries(message.gameModes).forEach(([key, value]) => {
|
Object.entries(message.gameModes).forEach(([key, value]) => {
|
||||||
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
GameDefinitions_GameModesEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(26).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
Object.entries(message.roles).forEach(([key, value]) => {
|
Object.entries(message.roles).forEach(([key, value]) => {
|
||||||
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
GameDefinitions_RolesEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(34).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions();
|
const message = createBaseGameDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -85,7 +95,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
|
const entry3 = GameDefinitions_GameModesEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry3.value !== undefined) {
|
if (entry3.value !== undefined) {
|
||||||
message.gameModes[entry3.key] = entry3.value;
|
message.gameModes[entry3.key] = entry3.value;
|
||||||
}
|
}
|
||||||
@@ -96,7 +109,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
|
const entry4 = GameDefinitions_RolesEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry4.value !== undefined) {
|
if (entry4.value !== undefined) {
|
||||||
message.roles[entry4.key] = entry4.value;
|
message.roles[entry4.key] = entry4.value;
|
||||||
}
|
}
|
||||||
@@ -113,26 +129,36 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions {
|
fromJSON(object: any): GameDefinitions {
|
||||||
return {
|
return {
|
||||||
version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
|
version: globalThis.String(
|
||||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
assertSet('GameDefinitions.version', object.version),
|
||||||
|
),
|
||||||
|
nations: globalThis.Array.isArray(object?.nations)
|
||||||
|
? object.nations.map((e: any) => globalThis.String(e))
|
||||||
|
: [],
|
||||||
gameModes: isObject(object.gameModes)
|
gameModes: isObject(object.gameModes)
|
||||||
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
|
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>(
|
||||||
|
(acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
roles: isObject(object.roles)
|
roles: isObject(object.roles)
|
||||||
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>(
|
||||||
|
(acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameDefinitions): unknown {
|
toJSON(message: GameDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.version !== "") {
|
if (message.version !== '') {
|
||||||
obj.version = message.version;
|
obj.version = message.version;
|
||||||
}
|
}
|
||||||
if (message.nations?.length) {
|
if (message.nations?.length) {
|
||||||
@@ -159,23 +185,28 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(base?: I): GameDefinitions {
|
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): GameDefinitions {
|
||||||
return GameDefinitions.fromPartial(base ?? ({} as any));
|
return GameDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
|
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): GameDefinitions {
|
||||||
const message = createBaseGameDefinitions();
|
const message = createBaseGameDefinitions();
|
||||||
message.version = object.version ?? "";
|
message.version = object.version ?? '';
|
||||||
message.nations = object.nations?.map((e) => e) || [];
|
message.nations = object.nations?.map((e) => e) || [];
|
||||||
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
|
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: number]: GameMode;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
message.roles = Object.entries(object.roles ?? {}).reduce<{
|
||||||
);
|
[key: number]: GameModeRole;
|
||||||
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -189,8 +220,12 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn
|
|||||||
return { key: 0, value: createBaseGameMode() };
|
return { key: 0, value: createBaseGameMode() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> =
|
||||||
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: GameDefinitions_GameModesEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -200,8 +235,12 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): GameDefinitions_GameModesEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions_GameModesEntry();
|
const message = createBaseGameDefinitions_GameModesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -234,8 +273,12 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
|
assertSet('GameDefinitions_GameModesEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: GameMode.fromJSON(
|
||||||
|
assertSet('GameDefinitions_GameModesEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -250,27 +293,34 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(base?: I): GameDefinitions_GameModesEntry {
|
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): GameDefinitions_GameModesEntry {
|
||||||
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
|
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>,
|
||||||
): GameDefinitions_GameModesEntry {
|
>(object: I): GameDefinitions_GameModesEntry {
|
||||||
const message = createBaseGameDefinitions_GameModesEntry();
|
const message = createBaseGameDefinitions_GameModesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? GameMode.fromPartial(object.value)
|
? GameMode.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
||||||
return { key: 0, value: createBaseGameModeRole() };
|
return { key: 0, value: createBaseGameModeRole() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
|
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> =
|
||||||
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: GameDefinitions_RolesEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -280,8 +330,12 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): GameDefinitions_RolesEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions_RolesEntry();
|
const message = createBaseGameDefinitions_RolesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -314,8 +368,12 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions_RolesEntry {
|
fromJSON(object: any): GameDefinitions_RolesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
|
assertSet('GameDefinitions_RolesEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: GameModeRole.fromJSON(
|
||||||
|
assertSet('GameDefinitions_RolesEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -330,25 +388,33 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(base?: I): GameDefinitions_RolesEntry {
|
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): GameDefinitions_RolesEntry {
|
||||||
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
|
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(object: I): GameDefinitions_RolesEntry {
|
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
|
||||||
|
object: I,
|
||||||
|
): GameDefinitions_RolesEntry {
|
||||||
const message = createBaseGameDefinitions_RolesEntry();
|
const message = createBaseGameDefinitions_RolesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? GameModeRole.fromPartial(object.value)
|
? GameModeRole.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseGameMode(): GameMode {
|
function createBaseGameMode(): GameMode {
|
||||||
return { name: createBaseI18nString() };
|
return { name: createBaseI18nString() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameMode: MessageFns<GameMode> = {
|
export const GameMode: MessageFns<GameMode> = {
|
||||||
encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: GameMode,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.name !== undefined) {
|
if (message.name !== undefined) {
|
||||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||||
}
|
}
|
||||||
@@ -356,7 +422,8 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameMode();
|
const message = createBaseGameMode();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -380,7 +447,9 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fromJSON(object: any): GameMode {
|
fromJSON(object: any): GameMode {
|
||||||
return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) };
|
return {
|
||||||
|
name: I18nString.fromJSON(assertSet('GameMode.name', object.name)),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameMode): unknown {
|
toJSON(message: GameMode): unknown {
|
||||||
@@ -396,7 +465,8 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
|
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
|
||||||
const message = createBaseGameMode();
|
const message = createBaseGameMode();
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
return message;
|
return message;
|
||||||
@@ -408,7 +478,10 @@ function createBaseGameModeRole(): GameModeRole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GameModeRole: MessageFns<GameModeRole> = {
|
export const GameModeRole: MessageFns<GameModeRole> = {
|
||||||
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: GameModeRole,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
writer.uint32(10).fork();
|
||||||
for (const v of message.provisions) {
|
for (const v of message.provisions) {
|
||||||
writer.uint32(v);
|
writer.uint32(v);
|
||||||
@@ -423,7 +496,8 @@ export const GameModeRole: MessageFns<GameModeRole> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameModeRole();
|
const message = createBaseGameModeRole();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -496,10 +570,14 @@ export const GameModeRole: MessageFns<GameModeRole> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<GameModeRole>, I>>(base?: I): GameModeRole {
|
create<I extends Exact<DeepPartial<GameModeRole>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): GameModeRole {
|
||||||
return GameModeRole.fromPartial(base ?? ({} as any));
|
return GameModeRole.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
|
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(
|
||||||
|
object: I,
|
||||||
|
): GameModeRole {
|
||||||
const message = createBaseGameModeRole();
|
const message = createBaseGameModeRole();
|
||||||
message.provisions = object.provisions?.map((e) => e) || [];
|
message.provisions = object.provisions?.map((e) => e) || [];
|
||||||
message.consumables = object.consumables?.map((e) => e) || [];
|
message.consumables = object.consumables?.map((e) => e) || [];
|
||||||
@@ -507,21 +585,36 @@ export const GameModeRole: MessageFns<GameModeRole> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export interface I18nString_LocalesEntry {
|
|||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBaseI18nString(): I18nString {
|
export function createBaseI18nString(): I18nString {
|
||||||
return { locales: {} };
|
return { locales: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
// source: packages/core/src/protos/legacy_map_definitions.proto
|
// source: packages/core/src/protos/legacy_map_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface MapDefinitions {
|
export interface MapDefinitions {
|
||||||
maps: { [key: number]: MapDefinition };
|
maps: { [key: number]: MapDefinition };
|
||||||
@@ -29,15 +29,22 @@ function createBaseMapDefinitions(): MapDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||||
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: MapDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.maps).forEach(([key, value]) => {
|
Object.entries(message.maps).forEach(([key, value]) => {
|
||||||
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
MapDefinitions_MapsEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinitions();
|
const message = createBaseMapDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -48,7 +55,10 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = MapDefinitions_MapsEntry.decode(reader, reader.uint32());
|
const entry1 = MapDefinitions_MapsEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.maps[entry1.key] = entry1.value;
|
message.maps[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -66,10 +76,13 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
fromJSON(object: any): MapDefinitions {
|
fromJSON(object: any): MapDefinitions {
|
||||||
return {
|
return {
|
||||||
maps: isObject(object.maps)
|
maps: isObject(object.maps)
|
||||||
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>(
|
||||||
|
(acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -88,12 +101,18 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(base?: I): MapDefinitions {
|
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): MapDefinitions {
|
||||||
return MapDefinitions.fromPartial(base ?? ({} as any));
|
return MapDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): MapDefinitions {
|
||||||
const message = createBaseMapDefinitions();
|
const message = createBaseMapDefinitions();
|
||||||
message.maps = Object.entries(object.maps ?? {}).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
message.maps = Object.entries(object.maps ?? {}).reduce<{
|
||||||
|
[key: number]: MapDefinition;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -108,7 +127,10 @@ function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||||
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: MapDefinitions_MapsEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).int32(message.key);
|
writer.uint32(8).int32(message.key);
|
||||||
}
|
}
|
||||||
@@ -118,8 +140,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): MapDefinitions_MapsEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinitions_MapsEntry();
|
const message = createBaseMapDefinitions_MapsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -152,8 +178,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): MapDefinitions_MapsEntry {
|
fromJSON(object: any): MapDefinitions_MapsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("MapDefinitions_MapsEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: MapDefinition.fromJSON(assertSet("MapDefinitions_MapsEntry.value", object.value)),
|
assertSet('MapDefinitions_MapsEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: MapDefinition.fromJSON(
|
||||||
|
assertSet('MapDefinitions_MapsEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -168,13 +198,18 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(base?: I): MapDefinitions_MapsEntry {
|
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): MapDefinitions_MapsEntry {
|
||||||
return MapDefinitions_MapsEntry.fromPartial(base ?? ({} as any));
|
return MapDefinitions_MapsEntry.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(object: I): MapDefinitions_MapsEntry {
|
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
|
||||||
|
object: I,
|
||||||
|
): MapDefinitions_MapsEntry {
|
||||||
const message = createBaseMapDefinitions_MapsEntry();
|
const message = createBaseMapDefinitions_MapsEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? MapDefinition.fromPartial(object.value)
|
? MapDefinition.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
@@ -186,7 +221,10 @@ function createBaseMapDefinition(): MapDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinition: MessageFns<MapDefinition> = {
|
export const MapDefinition: MessageFns<MapDefinition> = {
|
||||||
encode(message: MapDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: MapDefinition,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -197,7 +235,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
|
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinition();
|
const message = createBaseMapDefinition();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -230,8 +269,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
|
|
||||||
fromJSON(object: any): MapDefinition {
|
fromJSON(object: any): MapDefinition {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("MapDefinition.id", object.id)),
|
id: globalThis.Number(assertSet('MapDefinition.id', object.id)),
|
||||||
name: I18nString.fromJSON(assertSet("MapDefinition.name", object.name)),
|
name: I18nString.fromJSON(assertSet('MapDefinition.name', object.name)),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -246,34 +285,54 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<MapDefinition>, I>>(base?: I): MapDefinition {
|
create<I extends Exact<DeepPartial<MapDefinition>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): MapDefinition {
|
||||||
return MapDefinition.fromPartial(base ?? ({} as any));
|
return MapDefinition.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(object: I): MapDefinition {
|
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(
|
||||||
|
object: I,
|
||||||
|
): MapDefinition {
|
||||||
const message = createBaseMapDefinition();
|
const message = createBaseMapDefinition();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
// source: packages/core/src/protos/legacy_provision_definitions.proto
|
// source: packages/core/src/protos/legacy_provision_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { ConsumableTankFilter } from "./legacy_consumable_definitions";
|
import { ConsumableTankFilter } from './legacy_consumable_definitions';
|
||||||
import { I18nString } from "./legacy_i18n";
|
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface ProvisionDefinitions {
|
export interface ProvisionDefinitions {
|
||||||
provisions: { [key: number]: Provision };
|
provisions: { [key: number]: Provision };
|
||||||
@@ -34,15 +34,25 @@ function createBaseProvisionDefinitions(): ProvisionDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||||
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: ProvisionDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.provisions).forEach(([key, value]) => {
|
Object.entries(message.provisions).forEach(([key, value]) => {
|
||||||
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ProvisionDefinitions_ProvisionsEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ProvisionDefinitions {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvisionDefinitions();
|
const message = createBaseProvisionDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -53,7 +63,10 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(reader, reader.uint32());
|
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.provisions[entry1.key] = entry1.value;
|
message.provisions[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -71,7 +84,9 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
fromJSON(object: any): ProvisionDefinitions {
|
fromJSON(object: any): ProvisionDefinitions {
|
||||||
return {
|
return {
|
||||||
provisions: isObject(object.provisions)
|
provisions: isObject(object.provisions)
|
||||||
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
|
? Object.entries(object.provisions).reduce<{
|
||||||
|
[key: number]: Provision;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
@@ -93,20 +108,23 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(base?: I): ProvisionDefinitions {
|
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): ProvisionDefinitions {
|
||||||
return ProvisionDefinitions.fromPartial(base ?? ({} as any));
|
return ProvisionDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): ProvisionDefinitions {
|
||||||
const message = createBaseProvisionDefinitions();
|
const message = createBaseProvisionDefinitions();
|
||||||
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
|
message.provisions = Object.entries(object.provisions ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: number]: Provision;
|
||||||
|
}>((acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -115,8 +133,12 @@ function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_
|
|||||||
return { key: 0, value: createBaseProvision() };
|
return { key: 0, value: createBaseProvision() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
|
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> =
|
||||||
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
|
encode(
|
||||||
|
message: ProvisionDefinitions_ProvisionsEntry,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== undefined) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
@@ -126,8 +148,12 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): ProvisionDefinitions_ProvisionsEntry {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -160,8 +186,12 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
|
|
||||||
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("ProvisionDefinitions_ProvisionsEntry.key", object.key)),
|
key: globalThis.Number(
|
||||||
value: Provision.fromJSON(assertSet("ProvisionDefinitions_ProvisionsEntry.value", object.value)),
|
assertSet('ProvisionDefinitions_ProvisionsEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: Provision.fromJSON(
|
||||||
|
assertSet('ProvisionDefinitions_ProvisionsEntry.value', object.value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -176,29 +206,42 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
create<
|
||||||
base?: I,
|
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
|
||||||
): ProvisionDefinitions_ProvisionsEntry {
|
>(base?: I): ProvisionDefinitions_ProvisionsEntry {
|
||||||
return ProvisionDefinitions_ProvisionsEntry.fromPartial(base ?? ({} as any));
|
return ProvisionDefinitions_ProvisionsEntry.fromPartial(
|
||||||
|
base ?? ({} as any),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
fromPartial<
|
||||||
object: I,
|
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
|
||||||
): ProvisionDefinitions_ProvisionsEntry {
|
>(object: I): ProvisionDefinitions_ProvisionsEntry {
|
||||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
? Provision.fromPartial(object.value)
|
? Provision.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseProvision(): Provision {
|
function createBaseProvision(): Provision {
|
||||||
return { id: 0, name: createBaseI18nString(), crew: undefined, game_mode_exclusive: false, include: [], exclude: [] };
|
return {
|
||||||
|
id: 0,
|
||||||
|
name: createBaseI18nString(),
|
||||||
|
crew: undefined,
|
||||||
|
game_mode_exclusive: false,
|
||||||
|
include: [],
|
||||||
|
exclude: [],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Provision: MessageFns<Provision> = {
|
export const Provision: MessageFns<Provision> = {
|
||||||
encode(message: Provision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: Provision,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -221,7 +264,8 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
|
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvision();
|
const message = createBaseProvision();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -264,7 +308,9 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
message.include.push(
|
||||||
|
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 7: {
|
case 7: {
|
||||||
@@ -272,7 +318,9 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
message.exclude.push(
|
||||||
|
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -286,10 +334,12 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Provision {
|
fromJSON(object: any): Provision {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Provision.id", object.id)),
|
id: globalThis.Number(assertSet('Provision.id', object.id)),
|
||||||
name: I18nString.fromJSON(assertSet("Provision.name", object.name)),
|
name: I18nString.fromJSON(assertSet('Provision.name', object.name)),
|
||||||
crew: isSet(object.crew) ? globalThis.Number(object.crew) : undefined,
|
crew: isSet(object.crew) ? globalThis.Number(object.crew) : undefined,
|
||||||
game_mode_exclusive: globalThis.Boolean(assertSet("Provision.game_mode_exclusive", object.game_mode_exclusive)),
|
game_mode_exclusive: globalThis.Boolean(
|
||||||
|
assertSet('Provision.game_mode_exclusive', object.game_mode_exclusive),
|
||||||
|
),
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -325,35 +375,55 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
|
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
|
||||||
return Provision.fromPartial(base ?? ({} as any));
|
return Provision.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(object: I): Provision {
|
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(
|
||||||
|
object: I,
|
||||||
|
): Provision {
|
||||||
const message = createBaseProvision();
|
const message = createBaseProvision();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
|
object.name !== undefined && object.name !== null
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: createBaseI18nString();
|
||||||
message.crew = object.crew ?? undefined;
|
message.crew = object.crew ?? undefined;
|
||||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.include =
|
||||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
|
message.exclude =
|
||||||
|
object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: 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>;
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -839,6 +839,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"tools": {
|
"tools": {
|
||||||
|
"api": {
|
||||||
|
"name": "API",
|
||||||
|
"description": "BlitzKit API docs",
|
||||||
|
"seo_description": "Comprehensive documentation and detailed insights into BlitzKit's API, enabling developers to integrate and utilize advanced features for World of Tanks Blitz efficiently."
|
||||||
|
},
|
||||||
|
|
||||||
"tanks": {
|
"tanks": {
|
||||||
"name": "Tankopedia",
|
"name": "Tankopedia",
|
||||||
"button": "Find tanks",
|
"button": "Find tanks",
|
||||||
|
|||||||
@@ -133,6 +133,14 @@ export const chartsTool: Tool = {
|
|||||||
branches: ['main', 'dev', 'opentest', 'preview'],
|
branches: ['main', 'dev', 'opentest', 'preview'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiTool: Tool = {
|
||||||
|
id: 'api',
|
||||||
|
button: {
|
||||||
|
color: 'indigo',
|
||||||
|
},
|
||||||
|
image: '0bWE5hC',
|
||||||
|
};
|
||||||
|
|
||||||
export const TOOLS: Tool[] = [
|
export const TOOLS: Tool[] = [
|
||||||
tanksTool,
|
tanksTool,
|
||||||
compareTool,
|
compareTool,
|
||||||
@@ -142,5 +150,6 @@ export const TOOLS: Tool[] = [
|
|||||||
sessionTool,
|
sessionTool,
|
||||||
tierListTool,
|
tierListTool,
|
||||||
embedTool,
|
embedTool,
|
||||||
|
apiTool,
|
||||||
// ratingTool,
|
// ratingTool,
|
||||||
];
|
];
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
import { Code, Flex, Link } from '@radix-ui/themes';
|
||||||
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
|
import { apiTool } from '../../../constants/tools';
|
||||||
|
import ToolLayout from '../../../layouts/ToolLayout.astro';
|
||||||
|
|
||||||
|
export { getStaticPaths } from '../index.astro';
|
||||||
|
|
||||||
|
const regex = /\/\*\*\n(( \* .+\n)+.+)\n \*\/\nexport const GET/gm;
|
||||||
|
const ROOT = '/src/pages/api/';
|
||||||
|
const glob = import.meta.glob('/src/pages/api/**/*.ts', {
|
||||||
|
eager: true,
|
||||||
|
query: '?raw',
|
||||||
|
import: 'default',
|
||||||
|
});
|
||||||
|
const apis: {
|
||||||
|
path: string;
|
||||||
|
content: string;
|
||||||
|
}[] = [];
|
||||||
|
|
||||||
|
for (const rawPath in glob) {
|
||||||
|
const content = (glob[rawPath] as string).replaceAll('\r', '');
|
||||||
|
const regexExecution = regex.exec(content);
|
||||||
|
|
||||||
|
if (!regexExecution?.[1]) continue;
|
||||||
|
|
||||||
|
const comment = regexExecution[1].replaceAll(/^ \* /gm, '');
|
||||||
|
|
||||||
|
console.log();
|
||||||
|
|
||||||
|
const path = rawPath.replace(ROOT, '');
|
||||||
|
|
||||||
|
apis.push({ path, content });
|
||||||
|
}
|
||||||
|
---
|
||||||
|
|
||||||
|
<ToolLayout tool={apiTool}>
|
||||||
|
<PageWrapper>
|
||||||
|
{
|
||||||
|
apis.map((api) => (
|
||||||
|
<Flex direction="column">
|
||||||
|
<Link href={api.path}>{api.path}</Link>
|
||||||
|
|
||||||
|
<Code>{api.content}</Code>
|
||||||
|
</Flex>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</PageWrapper>
|
||||||
|
</ToolLayout>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { imgur } from '@blitzkit/core';
|
||||||
import { DEFAULT_LOCALE } from '@blitzkit/i18n';
|
import { DEFAULT_LOCALE } from '@blitzkit/i18n';
|
||||||
import type { APIRoute, GetStaticPaths } from 'astro';
|
import type { APIRoute, GetStaticPaths } from 'astro';
|
||||||
import { fetchGlossary } from '../../../core/blitz/fetchGlossary';
|
import { fetchGlossary } from '../../../core/blitz/fetchGlossary';
|
||||||
@@ -13,10 +14,18 @@ export const getStaticPaths = (async () => {
|
|||||||
|
|
||||||
const glossary = await fetchGlossary(DEFAULT_LOCALE);
|
const glossary = await fetchGlossary(DEFAULT_LOCALE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test comment.
|
||||||
|
* Test comment.
|
||||||
|
* Test comment.
|
||||||
|
* Test comment.
|
||||||
|
* Test comment.
|
||||||
|
* Test comment.
|
||||||
|
*/
|
||||||
export const GET: APIRoute<{}, { avatar: string }> = async ({ params }) => {
|
export const GET: APIRoute<{}, { avatar: string }> = async ({ params }) => {
|
||||||
const image =
|
const image =
|
||||||
glossary[`avatar_${params.avatar}`].image_url ??
|
glossary[`avatar_${params.avatar}`].image_url ??
|
||||||
'https://i.imgur.com/uXBiK05.jpeg';
|
imgur('uXBiK05', { format: 'jpeg' });
|
||||||
|
|
||||||
if (import.meta.env.MODE === 'development') {
|
if (import.meta.env.MODE === 'development') {
|
||||||
return Response.redirect(image);
|
return Response.redirect(image);
|
||||||
|
|||||||
Reference in new issue
Block a user