mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: armors
This commit is contained in:
1 parent
652f36ba6c
commit
f5c00643e4
14 files changed
+2472
-3040
No files matched your search
@@ -18,7 +18,7 @@ export interface I18n_LocalesEntry {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function createBaseI18n(): I18n {
|
||||
function createBaseI18n(): I18n {
|
||||
return { locales: {} };
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
// source: packages/core/src/protos/legacy_camouflage_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./legacy_i18n";
|
||||
|
||||
export const protobufPackage = 'blitzkit';
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface CamouflageDefinitions {
|
||||
camouflages: { [key: number]: Camouflage };
|
||||
@@ -31,25 +31,15 @@ function createBaseCamouflageDefinitions(): 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]) => {
|
||||
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;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): CamouflageDefinitions {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflageDefinitions();
|
||||
while (reader.pos < end) {
|
||||
@@ -60,10 +50,7 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.camouflages[entry1.key] = entry1.value;
|
||||
}
|
||||
@@ -81,12 +68,10 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||
fromJSON(object: any): CamouflageDefinitions {
|
||||
return {
|
||||
camouflages: isObject(object.camouflages)
|
||||
? Object.entries(object.camouflages).reduce<{
|
||||
[key: number]: Camouflage;
|
||||
}>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
@@ -105,23 +90,20 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
||||
object: I,
|
||||
): CamouflageDefinitions {
|
||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
||||
const message = createBaseCamouflageDefinitions();
|
||||
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
|
||||
[key: number]: Camouflage;
|
||||
}>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -130,116 +112,90 @@ function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitio
|
||||
return { key: 0, value: createBaseCamouflage() };
|
||||
}
|
||||
|
||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
|
||||
{
|
||||
encode(
|
||||
message: CamouflageDefinitions_CamouflagesEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
|
||||
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): CamouflageDefinitions_CamouflagesEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Camouflage.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Camouflage.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
|
||||
),
|
||||
value: Camouflage.fromJSON(
|
||||
assertSet(
|
||||
'CamouflageDefinitions_CamouflagesEntry.value',
|
||||
object.value,
|
||||
),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Camouflage.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<
|
||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
|
||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
|
||||
base ?? ({} as any),
|
||||
);
|
||||
},
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||
>(object: I): CamouflageDefinitions_CamouflagesEntry {
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? Camouflage.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||
return {
|
||||
key: globalThis.Number(assertSet("CamouflageDefinitions_CamouflagesEntry.key", object.key)),
|
||||
value: Camouflage.fromJSON(assertSet("CamouflageDefinitions_CamouflagesEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Camouflage.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||
base?: I,
|
||||
): CamouflageDefinitions_CamouflagesEntry {
|
||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||
object: I,
|
||||
): CamouflageDefinitions_CamouflagesEntry {
|
||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Camouflage.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCamouflage(): Camouflage {
|
||||
return {
|
||||
id: 0,
|
||||
name: 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> = {
|
||||
encode(
|
||||
message: Camouflage,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
@@ -250,17 +206,13 @@ export const Camouflage: MessageFns<Camouflage> = {
|
||||
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
||||
}
|
||||
if (message.tank_name_full !== undefined) {
|
||||
I18nString.encode(
|
||||
message.tank_name_full,
|
||||
writer.uint32(34).fork(),
|
||||
).join();
|
||||
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCamouflage();
|
||||
while (reader.pos < end) {
|
||||
@@ -309,14 +261,10 @@ export const Camouflage: MessageFns<Camouflage> = {
|
||||
|
||||
fromJSON(object: any): Camouflage {
|
||||
return {
|
||||
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
|
||||
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
|
||||
tank_name: isSet(object.tank_name)
|
||||
? I18nString.fromJSON(object.tank_name)
|
||||
: undefined,
|
||||
tank_name_full: isSet(object.tank_name_full)
|
||||
? I18nString.fromJSON(object.tank_name_full)
|
||||
: undefined,
|
||||
id: globalThis.Number(assertSet("Camouflage.id", object.id)),
|
||||
name: I18nString.fromJSON(assertSet("Camouflage.name", object.name)),
|
||||
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
|
||||
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -340,57 +288,37 @@ export const Camouflage: MessageFns<Camouflage> = {
|
||||
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
||||
return Camouflage.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
|
||||
object: I,
|
||||
): Camouflage {
|
||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
|
||||
const message = createBaseCamouflage();
|
||||
message.id = object.id ?? 0;
|
||||
message.name =
|
||||
object.name !== undefined && object.name !== null
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.tank_name =
|
||||
object.tank_name !== undefined && object.tank_name !== null
|
||||
? I18nString.fromPartial(object.tank_name)
|
||||
: undefined;
|
||||
message.tank_name_full =
|
||||
object.tank_name_full !== undefined && object.tank_name_full !== null
|
||||
? I18nString.fromPartial(object.tank_name_full)
|
||||
: undefined;
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
||||
? I18nString.fromPartial(object.tank_name)
|
||||
: undefined;
|
||||
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
||||
? I18nString.fromPartial(object.tank_name_full)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends globalThis.Array<infer U>
|
||||
? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown }
|
||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === 'object' && value !== null;
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,10 +5,10 @@
|
||||
// source: packages/core/src/protos/legacy_equipment_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./legacy_i18n";
|
||||
|
||||
export const protobufPackage = 'blitzkit';
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface EquipmentDefinitions {
|
||||
presets: { [key: string]: EquipmentPreset };
|
||||
@@ -44,31 +44,18 @@ function createBaseEquipmentDefinitions(): 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]) => {
|
||||
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]) => {
|
||||
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;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): EquipmentDefinitions {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions();
|
||||
while (reader.pos < end) {
|
||||
@@ -79,10 +66,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = EquipmentDefinitions_PresetsEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry1 = EquipmentDefinitions_PresetsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.presets[entry1.key] = entry1.value;
|
||||
}
|
||||
@@ -93,10 +77,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(reader, reader.uint32());
|
||||
if (entry2.value !== undefined) {
|
||||
message.equipments[entry2.key] = entry2.value;
|
||||
}
|
||||
@@ -114,20 +95,16 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||
fromJSON(object: any): EquipmentDefinitions {
|
||||
return {
|
||||
presets: isObject(object.presets)
|
||||
? Object.entries(object.presets).reduce<{
|
||||
[key: string]: EquipmentPreset;
|
||||
}>((acc, [key, value]) => {
|
||||
acc[key] = EquipmentPreset.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
|
||||
acc[key] = EquipmentPreset.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
equipments: isObject(object.equipments)
|
||||
? Object.entries(object.equipments).reduce<{
|
||||
[key: number]: Equipment;
|
||||
}>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
@@ -155,236 +132,203 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
|
||||
object: I,
|
||||
): EquipmentDefinitions {
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
||||
const message = createBaseEquipmentDefinitions();
|
||||
message.presets = Object.entries(object.presets ?? {}).reduce<{
|
||||
[key: string]: EquipmentPreset;
|
||||
}>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = EquipmentPreset.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
message.equipments = Object.entries(object.equipments ?? {}).reduce<{
|
||||
[key: number]: Equipment;
|
||||
}>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = EquipmentPreset.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
||||
return { key: '', value: createBaseEquipmentPreset() };
|
||||
return { key: "", value: createBaseEquipmentPreset() };
|
||||
}
|
||||
|
||||
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> =
|
||||
{
|
||||
encode(
|
||||
message: EquipmentDefinitions_PresetsEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
|
||||
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = EquipmentPreset.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = EquipmentPreset.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
||||
return {
|
||||
key: globalThis.String(
|
||||
assertSet('EquipmentDefinitions_PresetsEntry.key', object.key),
|
||||
),
|
||||
value: EquipmentPreset.fromJSON(
|
||||
assertSet('EquipmentDefinitions_PresetsEntry.value', object.value),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = message.key;
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = EquipmentPreset.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
||||
base?: I,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>,
|
||||
>(object: I): EquipmentDefinitions_PresetsEntry {
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
message.key = object.key ?? '';
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? EquipmentPreset.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
||||
return {
|
||||
key: globalThis.String(assertSet("EquipmentDefinitions_PresetsEntry.key", object.key)),
|
||||
value: EquipmentPreset.fromJSON(assertSet("EquipmentDefinitions_PresetsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = EquipmentPreset.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
||||
base?: I,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
|
||||
object: I,
|
||||
): EquipmentDefinitions_PresetsEntry {
|
||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||
message.key = object.key ?? "";
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? EquipmentPreset.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
||||
return { key: 0, value: createBaseEquipment() };
|
||||
}
|
||||
|
||||
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> =
|
||||
{
|
||||
encode(
|
||||
message: EquipmentDefinitions_EquipmentsEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Equipment.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
|
||||
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Equipment.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): EquipmentDefinitions_EquipmentsEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Equipment.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Equipment.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('EquipmentDefinitions_EquipmentsEntry.key', object.key),
|
||||
),
|
||||
value: Equipment.fromJSON(
|
||||
assertSet('EquipmentDefinitions_EquipmentsEntry.value', object.value),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Equipment.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<
|
||||
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
|
||||
>(base?: I): EquipmentDefinitions_EquipmentsEntry {
|
||||
return EquipmentDefinitions_EquipmentsEntry.fromPartial(
|
||||
base ?? ({} as any),
|
||||
);
|
||||
},
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
|
||||
>(object: I): EquipmentDefinitions_EquipmentsEntry {
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? Equipment.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
||||
return {
|
||||
key: globalThis.Number(assertSet("EquipmentDefinitions_EquipmentsEntry.key", object.key)),
|
||||
value: Equipment.fromJSON(assertSet("EquipmentDefinitions_EquipmentsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Equipment.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
||||
base?: I,
|
||||
): EquipmentDefinitions_EquipmentsEntry {
|
||||
return EquipmentDefinitions_EquipmentsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
|
||||
object: I,
|
||||
): EquipmentDefinitions_EquipmentsEntry {
|
||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Equipment.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEquipment(): Equipment {
|
||||
return { name: createBaseI18nString(), description: createBaseI18nString() };
|
||||
}
|
||||
|
||||
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) {
|
||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||
}
|
||||
@@ -395,8 +339,7 @@ export const Equipment: MessageFns<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;
|
||||
const message = createBaseEquipment();
|
||||
while (reader.pos < end) {
|
||||
@@ -429,10 +372,8 @@ export const Equipment: MessageFns<Equipment> = {
|
||||
|
||||
fromJSON(object: any): Equipment {
|
||||
return {
|
||||
name: I18nString.fromJSON(assertSet('Equipment.name', object.name)),
|
||||
description: I18nString.fromJSON(
|
||||
assertSet('Equipment.description', object.description),
|
||||
),
|
||||
name: I18nString.fromJSON(assertSet("Equipment.name", object.name)),
|
||||
description: I18nString.fromJSON(assertSet("Equipment.description", object.description)),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -450,18 +391,14 @@ export const Equipment: MessageFns<Equipment> = {
|
||||
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
|
||||
return Equipment.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(
|
||||
object: I,
|
||||
): Equipment {
|
||||
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(object: I): Equipment {
|
||||
const message = createBaseEquipment();
|
||||
message.name =
|
||||
object.name !== undefined && object.name !== null
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.description =
|
||||
object.description !== undefined && object.description !== null
|
||||
? I18nString.fromPartial(object.description)
|
||||
: createBaseI18nString();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.description = (object.description !== undefined && object.description !== null)
|
||||
? I18nString.fromPartial(object.description)
|
||||
: createBaseI18nString();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -471,10 +408,7 @@ function createBaseEquipmentPreset(): 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) {
|
||||
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
|
||||
}
|
||||
@@ -482,8 +416,7 @@ export const EquipmentPreset: MessageFns<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;
|
||||
const message = createBaseEquipmentPreset();
|
||||
while (reader.pos < end) {
|
||||
@@ -508,9 +441,7 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
||||
|
||||
fromJSON(object: any): EquipmentPreset {
|
||||
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)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -522,17 +453,12 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
|
||||
object: I,
|
||||
): EquipmentPreset {
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(object: I): EquipmentPreset {
|
||||
const message = createBaseEquipmentPreset();
|
||||
message.slots =
|
||||
object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
|
||||
message.slots = object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -542,10 +468,7 @@ function createBaseEquipmentSlot(): 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) {
|
||||
writer.uint32(8).uint32(message.left);
|
||||
}
|
||||
@@ -556,8 +479,7 @@ export const EquipmentSlot: MessageFns<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;
|
||||
const message = createBaseEquipmentSlot();
|
||||
while (reader.pos < end) {
|
||||
@@ -590,8 +512,8 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
||||
|
||||
fromJSON(object: any): EquipmentSlot {
|
||||
return {
|
||||
left: globalThis.Number(assertSet('EquipmentSlot.left', object.left)),
|
||||
right: globalThis.Number(assertSet('EquipmentSlot.right', object.right)),
|
||||
left: globalThis.Number(assertSet("EquipmentSlot.left", object.left)),
|
||||
right: globalThis.Number(assertSet("EquipmentSlot.right", object.right)),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -606,14 +528,10 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
|
||||
object: I,
|
||||
): EquipmentSlot {
|
||||
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(object: I): EquipmentSlot {
|
||||
const message = createBaseEquipmentSlot();
|
||||
message.left = object.left ?? 0;
|
||||
message.right = object.right ?? 0;
|
||||
@@ -621,36 +539,21 @@ 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
|
||||
: T extends globalThis.Array<infer U>
|
||||
? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown }
|
||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === 'object' && value !== null;
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
// source: packages/core/src/protos/legacy_game_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./legacy_i18n";
|
||||
|
||||
export const protobufPackage = 'blitzkit';
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface GameDefinitions {
|
||||
version: string;
|
||||
@@ -37,38 +37,28 @@ export interface GameModeRole {
|
||||
}
|
||||
|
||||
function createBaseGameDefinitions(): GameDefinitions {
|
||||
return { version: '', nations: [], gameModes: {}, roles: {} };
|
||||
return { version: "", nations: [], gameModes: {}, roles: {} };
|
||||
}
|
||||
|
||||
export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
encode(
|
||||
message: GameDefinitions,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.version !== '') {
|
||||
encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.version !== "") {
|
||||
writer.uint32(10).string(message.version);
|
||||
}
|
||||
for (const v of message.nations) {
|
||||
writer.uint32(18).string(v!);
|
||||
}
|
||||
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]) => {
|
||||
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;
|
||||
},
|
||||
|
||||
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;
|
||||
const message = createBaseGameDefinitions();
|
||||
while (reader.pos < end) {
|
||||
@@ -95,10 +85,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry3 = GameDefinitions_GameModesEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
|
||||
if (entry3.value !== undefined) {
|
||||
message.gameModes[entry3.key] = entry3.value;
|
||||
}
|
||||
@@ -109,10 +96,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry4 = GameDefinitions_RolesEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
|
||||
if (entry4.value !== undefined) {
|
||||
message.roles[entry4.key] = entry4.value;
|
||||
}
|
||||
@@ -129,36 +113,26 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
|
||||
fromJSON(object: any): GameDefinitions {
|
||||
return {
|
||||
version: globalThis.String(
|
||||
assertSet('GameDefinitions.version', object.version),
|
||||
),
|
||||
nations: globalThis.Array.isArray(object?.nations)
|
||||
? object.nations.map((e: any) => globalThis.String(e))
|
||||
: [],
|
||||
version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
|
||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
||||
gameModes: isObject(object.gameModes)
|
||||
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>(
|
||||
(acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
roles: isObject(object.roles)
|
||||
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>(
|
||||
(acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.version !== '') {
|
||||
if (message.version !== "") {
|
||||
obj.version = message.version;
|
||||
}
|
||||
if (message.nations?.length) {
|
||||
@@ -185,28 +159,23 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(
|
||||
object: I,
|
||||
): GameDefinitions {
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
|
||||
const message = createBaseGameDefinitions();
|
||||
message.version = object.version ?? '';
|
||||
message.version = object.version ?? "";
|
||||
message.nations = object.nations?.map((e) => e) || [];
|
||||
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{
|
||||
[key: number]: GameMode;
|
||||
}>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
message.roles = Object.entries(object.roles ?? {}).reduce<{
|
||||
[key: number]: GameModeRole;
|
||||
}>((acc, [key, value]) => {
|
||||
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
||||
}
|
||||
@@ -220,201 +189,166 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn
|
||||
return { key: 0, value: createBaseGameMode() };
|
||||
}
|
||||
|
||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> =
|
||||
{
|
||||
encode(
|
||||
message: GameDefinitions_GameModesEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameMode.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
||||
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameMode.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): GameDefinitions_GameModesEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameMode.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameMode.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('GameDefinitions_GameModesEntry.key', object.key),
|
||||
),
|
||||
value: GameMode.fromJSON(
|
||||
assertSet('GameDefinitions_GameModesEntry.value', object.value),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameMode.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
|
||||
base?: I,
|
||||
): GameDefinitions_GameModesEntry {
|
||||
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>,
|
||||
>(object: I): GameDefinitions_GameModesEntry {
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? GameMode.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||
return {
|
||||
key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
|
||||
value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameMode.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(base?: I): GameDefinitions_GameModesEntry {
|
||||
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
|
||||
object: I,
|
||||
): GameDefinitions_GameModesEntry {
|
||||
const message = createBaseGameDefinitions_GameModesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? GameMode.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
||||
return { key: 0, value: createBaseGameModeRole() };
|
||||
}
|
||||
|
||||
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> =
|
||||
{
|
||||
encode(
|
||||
message: GameDefinitions_RolesEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
|
||||
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): GameDefinitions_RolesEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameModeRole.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = GameModeRole.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GameDefinitions_RolesEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('GameDefinitions_RolesEntry.key', object.key),
|
||||
),
|
||||
value: GameModeRole.fromJSON(
|
||||
assertSet('GameDefinitions_RolesEntry.value', object.value),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_RolesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameModeRole.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
|
||||
base?: I,
|
||||
): GameDefinitions_RolesEntry {
|
||||
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
|
||||
object: I,
|
||||
): GameDefinitions_RolesEntry {
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? GameModeRole.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): GameDefinitions_RolesEntry {
|
||||
return {
|
||||
key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
|
||||
value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GameDefinitions_RolesEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = GameModeRole.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(base?: I): GameDefinitions_RolesEntry {
|
||||
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(object: I): GameDefinitions_RolesEntry {
|
||||
const message = createBaseGameDefinitions_RolesEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? GameModeRole.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGameMode(): GameMode {
|
||||
return { name: createBaseI18nString() };
|
||||
}
|
||||
|
||||
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) {
|
||||
I18nString.encode(message.name, writer.uint32(10).fork()).join();
|
||||
}
|
||||
@@ -422,8 +356,7 @@ export const GameMode: MessageFns<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;
|
||||
const message = createBaseGameMode();
|
||||
while (reader.pos < end) {
|
||||
@@ -447,9 +380,7 @@ export const GameMode: MessageFns<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 {
|
||||
@@ -465,10 +396,9 @@ export const GameMode: MessageFns<GameMode> = {
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
|
||||
const message = createBaseGameMode();
|
||||
message.name =
|
||||
object.name !== undefined && object.name !== null
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -478,10 +408,7 @@ function createBaseGameModeRole(): 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();
|
||||
for (const v of message.provisions) {
|
||||
writer.uint32(v);
|
||||
@@ -496,8 +423,7 @@ export const GameModeRole: MessageFns<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;
|
||||
const message = createBaseGameModeRole();
|
||||
while (reader.pos < end) {
|
||||
@@ -570,14 +496,10 @@ export const GameModeRole: MessageFns<GameModeRole> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(
|
||||
object: I,
|
||||
): GameModeRole {
|
||||
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
|
||||
const message = createBaseGameModeRole();
|
||||
message.provisions = object.provisions?.map((e) => e) || [];
|
||||
message.consumables = object.consumables?.map((e) => e) || [];
|
||||
@@ -585,36 +507,21 @@ 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
|
||||
: T extends globalThis.Array<infer U>
|
||||
? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown }
|
||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === 'object' && value !== null;
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface I18nString_LocalesEntry {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function createBaseI18nString(): I18nString {
|
||||
function createBaseI18nString(): I18nString {
|
||||
return { locales: {} };
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
// source: packages/core/src/protos/legacy_map_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18nString } from "./legacy_i18n";
|
||||
|
||||
export const protobufPackage = 'blitzkit';
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface MapDefinitions {
|
||||
maps: { [key: number]: MapDefinition };
|
||||
@@ -29,22 +29,15 @@ function createBaseMapDefinitions(): 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]) => {
|
||||
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;
|
||||
},
|
||||
|
||||
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;
|
||||
const message = createBaseMapDefinitions();
|
||||
while (reader.pos < end) {
|
||||
@@ -55,10 +48,7 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = MapDefinitions_MapsEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry1 = MapDefinitions_MapsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.maps[entry1.key] = entry1.value;
|
||||
}
|
||||
@@ -76,13 +66,10 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||
fromJSON(object: any): MapDefinitions {
|
||||
return {
|
||||
maps: isObject(object.maps)
|
||||
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>(
|
||||
(acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
)
|
||||
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
@@ -101,18 +88,12 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(
|
||||
object: I,
|
||||
): MapDefinitions {
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
||||
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) {
|
||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
||||
}
|
||||
@@ -127,10 +108,7 @@ function createBaseMapDefinitions_MapsEntry(): 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) {
|
||||
writer.uint32(8).int32(message.key);
|
||||
}
|
||||
@@ -140,12 +118,8 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): MapDefinitions_MapsEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
decode(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;
|
||||
const message = createBaseMapDefinitions_MapsEntry();
|
||||
while (reader.pos < end) {
|
||||
@@ -178,12 +152,8 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||
|
||||
fromJSON(object: any): MapDefinitions_MapsEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('MapDefinitions_MapsEntry.key', object.key),
|
||||
),
|
||||
value: MapDefinition.fromJSON(
|
||||
assertSet('MapDefinitions_MapsEntry.value', object.value),
|
||||
),
|
||||
key: globalThis.Number(assertSet("MapDefinitions_MapsEntry.key", object.key)),
|
||||
value: MapDefinition.fromJSON(assertSet("MapDefinitions_MapsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -198,20 +168,15 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||
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));
|
||||
},
|
||||
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();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? MapDefinition.fromPartial(object.value)
|
||||
: undefined;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? MapDefinition.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -221,10 +186,7 @@ function createBaseMapDefinition(): 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) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
@@ -235,8 +197,7 @@ export const MapDefinition: MessageFns<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;
|
||||
const message = createBaseMapDefinition();
|
||||
while (reader.pos < end) {
|
||||
@@ -269,8 +230,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
||||
|
||||
fromJSON(object: any): MapDefinition {
|
||||
return {
|
||||
id: globalThis.Number(assertSet('MapDefinition.id', object.id)),
|
||||
name: I18nString.fromJSON(assertSet('MapDefinition.name', object.name)),
|
||||
id: globalThis.Number(assertSet("MapDefinition.id", object.id)),
|
||||
name: I18nString.fromJSON(assertSet("MapDefinition.name", object.name)),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -285,54 +246,34 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(
|
||||
object: I,
|
||||
): MapDefinition {
|
||||
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(object: I): MapDefinition {
|
||||
const message = createBaseMapDefinition();
|
||||
message.id = object.id ?? 0;
|
||||
message.name =
|
||||
object.name !== undefined && object.name !== null
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
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
|
||||
: T extends globalThis.Array<infer U>
|
||||
? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown }
|
||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === 'object' && value !== null;
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
// source: packages/core/src/protos/legacy_provision_definitions.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||
import { ConsumableTankFilter } from './legacy_consumable_definitions';
|
||||
import { I18nString, createBaseI18nString } from './legacy_i18n';
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { ConsumableTankFilter } from "./legacy_consumable_definitions";
|
||||
import { I18nString } from "./legacy_i18n";
|
||||
|
||||
export const protobufPackage = 'blitzkit';
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
export interface ProvisionDefinitions {
|
||||
provisions: { [key: number]: Provision };
|
||||
@@ -34,25 +34,15 @@ function createBaseProvisionDefinitions(): 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]) => {
|
||||
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;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): ProvisionDefinitions {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseProvisionDefinitions();
|
||||
while (reader.pos < end) {
|
||||
@@ -63,10 +53,7 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(
|
||||
reader,
|
||||
reader.uint32(),
|
||||
);
|
||||
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.provisions[entry1.key] = entry1.value;
|
||||
}
|
||||
@@ -84,12 +71,10 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||
fromJSON(object: any): ProvisionDefinitions {
|
||||
return {
|
||||
provisions: isObject(object.provisions)
|
||||
? Object.entries(object.provisions).reduce<{
|
||||
[key: number]: Provision;
|
||||
}>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
|
||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
@@ -108,23 +93,20 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||
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));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
|
||||
object: I,
|
||||
): ProvisionDefinitions {
|
||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
||||
const message = createBaseProvisionDefinitions();
|
||||
message.provisions = Object.entries(object.provisions ?? {}).reduce<{
|
||||
[key: number]: Provision;
|
||||
}>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -133,115 +115,90 @@ function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_
|
||||
return { key: 0, value: createBaseProvision() };
|
||||
}
|
||||
|
||||
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> =
|
||||
{
|
||||
encode(
|
||||
message: ProvisionDefinitions_ProvisionsEntry,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Provision.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
|
||||
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(8).uint32(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
Provision.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: BinaryReader | Uint8Array,
|
||||
length?: number,
|
||||
): ProvisionDefinitions_ProvisionsEntry {
|
||||
const reader =
|
||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
decode(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;
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Provision.decode(reader, reader.uint32());
|
||||
continue;
|
||||
message.key = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = Provision.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
||||
return {
|
||||
key: globalThis.Number(
|
||||
assertSet('ProvisionDefinitions_ProvisionsEntry.key', object.key),
|
||||
),
|
||||
value: Provision.fromJSON(
|
||||
assertSet('ProvisionDefinitions_ProvisionsEntry.value', object.value),
|
||||
),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Provision.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
create<
|
||||
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
|
||||
>(base?: I): ProvisionDefinitions_ProvisionsEntry {
|
||||
return ProvisionDefinitions_ProvisionsEntry.fromPartial(
|
||||
base ?? ({} as any),
|
||||
);
|
||||
},
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
|
||||
>(object: I): ProvisionDefinitions_ProvisionsEntry {
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value =
|
||||
object.value !== undefined && object.value !== null
|
||||
? Provision.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
||||
return {
|
||||
key: globalThis.Number(assertSet("ProvisionDefinitions_ProvisionsEntry.key", object.key)),
|
||||
value: Provision.fromJSON(assertSet("ProvisionDefinitions_ProvisionsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = Math.round(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = Provision.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
||||
base?: I,
|
||||
): ProvisionDefinitions_ProvisionsEntry {
|
||||
return ProvisionDefinitions_ProvisionsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
|
||||
object: I,
|
||||
): ProvisionDefinitions_ProvisionsEntry {
|
||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||
message.key = object.key ?? 0;
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? Provision.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseProvision(): Provision {
|
||||
return {
|
||||
id: 0,
|
||||
name: 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> = {
|
||||
encode(
|
||||
message: Provision,
|
||||
writer: BinaryWriter = new BinaryWriter(),
|
||||
): BinaryWriter {
|
||||
encode(message: Provision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).uint32(message.id);
|
||||
}
|
||||
@@ -264,8 +221,7 @@ export const Provision: MessageFns<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;
|
||||
const message = createBaseProvision();
|
||||
while (reader.pos < end) {
|
||||
@@ -308,9 +264,7 @@ export const Provision: MessageFns<Provision> = {
|
||||
break;
|
||||
}
|
||||
|
||||
message.include.push(
|
||||
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||
);
|
||||
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
case 7: {
|
||||
@@ -318,9 +272,7 @@ export const Provision: MessageFns<Provision> = {
|
||||
break;
|
||||
}
|
||||
|
||||
message.exclude.push(
|
||||
ConsumableTankFilter.decode(reader, reader.uint32()),
|
||||
);
|
||||
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -334,12 +286,10 @@ export const Provision: MessageFns<Provision> = {
|
||||
|
||||
fromJSON(object: any): Provision {
|
||||
return {
|
||||
id: globalThis.Number(assertSet('Provision.id', object.id)),
|
||||
name: I18nString.fromJSON(assertSet('Provision.name', object.name)),
|
||||
id: globalThis.Number(assertSet("Provision.id", object.id)),
|
||||
name: I18nString.fromJSON(assertSet("Provision.name", object.name)),
|
||||
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)
|
||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||
: [],
|
||||
@@ -375,55 +325,35 @@ export const Provision: MessageFns<Provision> = {
|
||||
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
|
||||
return Provision.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(
|
||||
object: I,
|
||||
): Provision {
|
||||
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(object: I): Provision {
|
||||
const message = createBaseProvision();
|
||||
message.id = object.id ?? 0;
|
||||
message.name =
|
||||
object.name !== undefined && object.name !== null
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18nString.fromPartial(object.name)
|
||||
: createBaseI18nString();
|
||||
message.crew = object.crew ?? undefined;
|
||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||
message.include =
|
||||
object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
message.exclude =
|
||||
object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends globalThis.Array<infer U>
|
||||
? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown }
|
||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === 'object' && value !== null;
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -8,4 +8,12 @@ message Tank {
|
||||
required string id = 1;
|
||||
required string slug = 2;
|
||||
required I18n name = 3;
|
||||
// key can only ever be "chassis", "hull", "turret", or "gun"
|
||||
map<string, PenetrationGroup> penetration_groups = 4;
|
||||
}
|
||||
|
||||
message PenetrationGroup {
|
||||
// keys are mostly "armor_xyz" where xyz is an integer but sometimes can be
|
||||
// things like "commander", "rightTrack", etc.
|
||||
map<string, float> armors = 1;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/* eslint-disable */
|
||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||
import { I18n, createBaseI18n } from "./i18n";
|
||||
import { I18n } from "./i18n";
|
||||
|
||||
export const protobufPackage = "blitzkit";
|
||||
|
||||
@@ -14,10 +14,26 @@ export interface Tank {
|
||||
id: string;
|
||||
slug: string;
|
||||
name: I18n;
|
||||
/** key can only ever be "chassis", "hull", "turret", or "gun" */
|
||||
penetration_groups: { [key: string]: PenetrationGroup };
|
||||
}
|
||||
|
||||
export interface Tank_PenetrationGroupsEntry {
|
||||
key: string;
|
||||
value: PenetrationGroup | undefined;
|
||||
}
|
||||
|
||||
export interface PenetrationGroup {
|
||||
armors: { [key: string]: number };
|
||||
}
|
||||
|
||||
export interface PenetrationGroup_ArmorsEntry {
|
||||
key: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
function createBaseTank(): Tank {
|
||||
return { id: "", slug: "", name: createBaseI18n() };
|
||||
return { id: "", slug: "", name: createBaseI18n(), penetration_groups: {} };
|
||||
}
|
||||
|
||||
export const Tank: MessageFns<Tank> = {
|
||||
@@ -31,6 +47,9 @@ export const Tank: MessageFns<Tank> = {
|
||||
if (message.name !== undefined) {
|
||||
I18n.encode(message.name, writer.uint32(26).fork()).join();
|
||||
}
|
||||
Object.entries(message.penetration_groups).forEach(([key, value]) => {
|
||||
Tank_PenetrationGroupsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
@@ -65,6 +84,17 @@ export const Tank: MessageFns<Tank> = {
|
||||
message.name = I18n.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry4 = Tank_PenetrationGroupsEntry.decode(reader, reader.uint32());
|
||||
if (entry4.value !== undefined) {
|
||||
message.penetration_groups[entry4.key] = entry4.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
@@ -79,6 +109,12 @@ export const Tank: MessageFns<Tank> = {
|
||||
id: globalThis.String(assertSet("Tank.id", object.id)),
|
||||
slug: globalThis.String(assertSet("Tank.slug", object.slug)),
|
||||
name: I18n.fromJSON(assertSet("Tank.name", object.name)),
|
||||
penetration_groups: isObject(object.penetration_groups)
|
||||
? Object.entries(object.penetration_groups).reduce<{ [key: string]: PenetrationGroup }>((acc, [key, value]) => {
|
||||
acc[key] = PenetrationGroup.fromJSON(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -93,6 +129,15 @@ export const Tank: MessageFns<Tank> = {
|
||||
if (message.name !== undefined) {
|
||||
obj.name = I18n.toJSON(message.name);
|
||||
}
|
||||
if (message.penetration_groups) {
|
||||
const entries = Object.entries(message.penetration_groups);
|
||||
if (entries.length > 0) {
|
||||
obj.penetration_groups = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.penetration_groups[k] = PenetrationGroup.toJSON(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
@@ -106,6 +151,247 @@ export const Tank: MessageFns<Tank> = {
|
||||
message.name = (object.name !== undefined && object.name !== null)
|
||||
? I18n.fromPartial(object.name)
|
||||
: createBaseI18n();
|
||||
message.penetration_groups = Object.entries(object.penetration_groups ?? {}).reduce<
|
||||
{ [key: string]: PenetrationGroup }
|
||||
>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = PenetrationGroup.fromPartial(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseTank_PenetrationGroupsEntry(): Tank_PenetrationGroupsEntry {
|
||||
return { key: "", value: createBasePenetrationGroup() };
|
||||
}
|
||||
|
||||
export const Tank_PenetrationGroupsEntry: MessageFns<Tank_PenetrationGroupsEntry> = {
|
||||
encode(message: Tank_PenetrationGroupsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
PenetrationGroup.encode(message.value, writer.uint32(18).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Tank_PenetrationGroupsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTank_PenetrationGroupsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = PenetrationGroup.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Tank_PenetrationGroupsEntry {
|
||||
return {
|
||||
key: globalThis.String(assertSet("Tank_PenetrationGroupsEntry.key", object.key)),
|
||||
value: PenetrationGroup.fromJSON(assertSet("Tank_PenetrationGroupsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Tank_PenetrationGroupsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = PenetrationGroup.toJSON(message.value);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Tank_PenetrationGroupsEntry>, I>>(base?: I): Tank_PenetrationGroupsEntry {
|
||||
return Tank_PenetrationGroupsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Tank_PenetrationGroupsEntry>, I>>(object: I): Tank_PenetrationGroupsEntry {
|
||||
const message = createBaseTank_PenetrationGroupsEntry();
|
||||
message.key = object.key ?? "";
|
||||
message.value = (object.value !== undefined && object.value !== null)
|
||||
? PenetrationGroup.fromPartial(object.value)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePenetrationGroup(): PenetrationGroup {
|
||||
return { armors: {} };
|
||||
}
|
||||
|
||||
export const PenetrationGroup: MessageFns<PenetrationGroup> = {
|
||||
encode(message: PenetrationGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
Object.entries(message.armors).forEach(([key, value]) => {
|
||||
PenetrationGroup_ArmorsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||
});
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePenetrationGroup();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
const entry1 = PenetrationGroup_ArmorsEntry.decode(reader, reader.uint32());
|
||||
if (entry1.value !== undefined) {
|
||||
message.armors[entry1.key] = entry1.value;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PenetrationGroup {
|
||||
return {
|
||||
armors: isObject(object.armors)
|
||||
? Object.entries(object.armors).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
||||
acc[key] = Number(value);
|
||||
return acc;
|
||||
}, {})
|
||||
: {},
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PenetrationGroup): unknown {
|
||||
const obj: any = {};
|
||||
if (message.armors) {
|
||||
const entries = Object.entries(message.armors);
|
||||
if (entries.length > 0) {
|
||||
obj.armors = {};
|
||||
entries.forEach(([k, v]) => {
|
||||
obj.armors[k] = v;
|
||||
});
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PenetrationGroup>, I>>(base?: I): PenetrationGroup {
|
||||
return PenetrationGroup.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PenetrationGroup>, I>>(object: I): PenetrationGroup {
|
||||
const message = createBasePenetrationGroup();
|
||||
message.armors = Object.entries(object.armors ?? {}).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
||||
if (value !== undefined) {
|
||||
acc[key] = globalThis.Number(value);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePenetrationGroup_ArmorsEntry(): PenetrationGroup_ArmorsEntry {
|
||||
return { key: "", value: 0 };
|
||||
}
|
||||
|
||||
export const PenetrationGroup_ArmorsEntry: MessageFns<PenetrationGroup_ArmorsEntry> = {
|
||||
encode(message: PenetrationGroup_ArmorsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.key !== undefined) {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
writer.uint32(21).float(message.value);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup_ArmorsEntry {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePenetrationGroup_ArmorsEntry();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 21) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.value = reader.float();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PenetrationGroup_ArmorsEntry {
|
||||
return {
|
||||
key: globalThis.String(assertSet("PenetrationGroup_ArmorsEntry.key", object.key)),
|
||||
value: globalThis.Number(assertSet("PenetrationGroup_ArmorsEntry.value", object.value)),
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PenetrationGroup_ArmorsEntry): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== undefined) {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.value !== undefined) {
|
||||
obj.value = message.value;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(base?: I): PenetrationGroup_ArmorsEntry {
|
||||
return PenetrationGroup_ArmorsEntry.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(object: I): PenetrationGroup_ArmorsEntry {
|
||||
const message = createBasePenetrationGroup_ArmorsEntry();
|
||||
message.key = object.key ?? "";
|
||||
message.value = object.value ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -123,6 +409,10 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function isObject(value: any): boolean {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
@@ -27,14 +27,21 @@ export function Page({ id }: PageProps) {
|
||||
function Model({ id }: { id: string }) {
|
||||
const gltf = useLoader(GLTFLoader, asset(`/tanks/${id}/collision/hull.glb`));
|
||||
|
||||
console.log(gltf);
|
||||
|
||||
return jsxTree(gltf.scene, {
|
||||
mesh: () => ({
|
||||
mesh: (mesh) => ({
|
||||
material: new MeshBasicMaterial({
|
||||
color: `rgb(${randInt(0, 255)}, ${randInt(0, 255)}, ${randInt(
|
||||
0,
|
||||
255,
|
||||
)})`,
|
||||
}),
|
||||
onClick: (event) => {
|
||||
if (!(mesh.material instanceof MeshBasicMaterial)) return;
|
||||
event.stopPropagation();
|
||||
console.log(mesh.material.name)
|
||||
},
|
||||
}),
|
||||
});
|
||||
}
|
||||
@@ -9,15 +9,40 @@ using CUE4Parse.UE4.Assets.Exports.Engine;
|
||||
using CUE4Parse.UE4.Assets.Exports.StaticMesh;
|
||||
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||
using CUE4Parse.UE4.Assets.Objects;
|
||||
using CUE4Parse.UE4.Assets.Objects.Properties;
|
||||
using CUE4Parse.UE4.Objects.UObject;
|
||||
using CUE4Parse.Utils;
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.Collections;
|
||||
using Org.BouncyCastle.Asn1.Misc;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace BlitzKit.CLI.Functions
|
||||
{
|
||||
public class Mangler(string[] args)
|
||||
public partial class Mangler(string[] args)
|
||||
{
|
||||
static readonly string PenetrationGroupNameMapPrefix =
|
||||
"EMintSDKProtoData_BlitzStaticTankUpgradeSingleStage_PenetrationGroupUpgrade_TankPart";
|
||||
static readonly Dictionary<string, string> PenetrationGroupNameMap = new Dictionary<
|
||||
string,
|
||||
string
|
||||
>
|
||||
{
|
||||
{ $"{PenetrationGroupNameMapPrefix}::TANK_PART_CHASSIS", "chassis" },
|
||||
{ $"{PenetrationGroupNameMapPrefix}::TANK_PART_HULL", "hull" },
|
||||
{ $"{PenetrationGroupNameMapPrefix}::TANK_PART_TURRET", "turret" },
|
||||
{ $"{PenetrationGroupNameMapPrefix}::TANK_PART_GUN", "gun" },
|
||||
};
|
||||
|
||||
[GeneratedRegex("[^a-z0-9]")]
|
||||
private static partial Regex NonAlphanumericRegex();
|
||||
|
||||
[GeneratedRegex("--+")]
|
||||
private static partial Regex MultipleDashesRegex();
|
||||
|
||||
[GeneratedRegex("-$")]
|
||||
private static partial Regex TrailingDashRegex();
|
||||
|
||||
readonly BlitzProvider provider = new(args.Contains("--depot"));
|
||||
Locales? locales;
|
||||
readonly Dictionary<string, Dictionary<string, string>> strings = [];
|
||||
@@ -192,9 +217,9 @@ namespace BlitzKit.CLI.Functions
|
||||
var id = PropertyUtil.Get<FName>(pda, "TankId").Text;
|
||||
var name = GetString($"TankEntity__{id.ToLowerInvariant()}__Short_Name");
|
||||
var slug = Diacritics.Remove(name.Locales["en"]).ToLower();
|
||||
slug = Regex.Replace(slug, "[^a-z0-9]", "-");
|
||||
slug = Regex.Replace(slug, "--+", "-");
|
||||
slug = Regex.Replace(slug, "-$", "");
|
||||
slug = NonAlphanumericRegex().Replace(slug, "-");
|
||||
slug = MultipleDashesRegex().Replace(slug, "-");
|
||||
slug = TrailingDashRegex().Replace(slug, "");
|
||||
|
||||
// await MangleHull(pda);
|
||||
// await MangleIcon(pda);
|
||||
@@ -206,9 +231,50 @@ namespace BlitzKit.CLI.Functions
|
||||
Slug = slug,
|
||||
};
|
||||
|
||||
tank.PenetrationGroups.MergeFrom(MangleArmor(pda));
|
||||
|
||||
return tank;
|
||||
}
|
||||
|
||||
MapField<string, PenetrationGroup> MangleArmor(UObject pda)
|
||||
{
|
||||
var id = PropertyUtil.Get<FName>(pda, "TankId").Text;
|
||||
MapField<string, PenetrationGroup> groups = [];
|
||||
var attributes = PropertyUtil.Get<UObject>(pda, "DA_Attributes");
|
||||
PropertyUtil.TryGet<UScriptMap>(attributes, "PenetrationGroups", out var penetrationGroups);
|
||||
|
||||
if (penetrationGroups == null)
|
||||
{
|
||||
PrettyLog.Warn($"Penetration groups missing for {id}; returning empty list");
|
||||
return groups;
|
||||
}
|
||||
|
||||
foreach (var group in penetrationGroups.Properties)
|
||||
{
|
||||
var rawName = ((FName)group.Key.GenericValue!).Text;
|
||||
var name = PenetrationGroupNameMap[rawName];
|
||||
var armors = PropertyUtil.Get<UScriptMap>(
|
||||
group.Value!.GetValue<FStructFallback>()!,
|
||||
"PenetrationGroups"
|
||||
);
|
||||
PenetrationGroup penetrationGroup = new();
|
||||
|
||||
foreach (var armorProperty in armors.Properties)
|
||||
{
|
||||
var armorName = ((FName)armorProperty.Key.GenericValue!).Text;
|
||||
var armorThickness = PropertyUtil.Get<float>(
|
||||
armorProperty.Value!.GetValue<FStructFallback>()!,
|
||||
"Armor"
|
||||
);
|
||||
penetrationGroup.Armors[armorName] = armorThickness;
|
||||
}
|
||||
|
||||
groups[name] = penetrationGroup;
|
||||
}
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
async Task MangleIcon(UObject pda)
|
||||
{
|
||||
var id = PropertyUtil.Get<FName>(pda, "TankId").Text;
|
||||
|
||||
@@ -25,13 +25,20 @@ namespace Blitzkit {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"CiNwYWNrYWdlcy9jb3JlL3NyYy9wcm90b3MvdGFuay5wcm90bxIIYmxpdHpr",
|
||||
"aXQaI3BhY2thZ2VzL2NvcmUvc3JjL3Byb3Rvcy9pMThuLnByb3RvIj4KBFRh",
|
||||
"bmsSCgoCaWQYASACKAkSDAoEc2x1ZxgCIAIoCRIcCgRuYW1lGAMgAigLMg4u",
|
||||
"YmxpdHpraXQuSTE4bg=="));
|
||||
"aXQaI3BhY2thZ2VzL2NvcmUvc3JjL3Byb3Rvcy9pMThuLnByb3RvItcBCgRU",
|
||||
"YW5rEgoKAmlkGAEgAigJEgwKBHNsdWcYAiACKAkSHAoEbmFtZRgDIAIoCzIO",
|
||||
"LmJsaXR6a2l0LkkxOG4SQQoScGVuZXRyYXRpb25fZ3JvdXBzGAQgAygLMiUu",
|
||||
"YmxpdHpraXQuVGFuay5QZW5ldHJhdGlvbkdyb3Vwc0VudHJ5GlQKFlBlbmV0",
|
||||
"cmF0aW9uR3JvdXBzRW50cnkSCwoDa2V5GAEgASgJEikKBXZhbHVlGAIgASgL",
|
||||
"MhouYmxpdHpraXQuUGVuZXRyYXRpb25Hcm91cDoCOAEieQoQUGVuZXRyYXRp",
|
||||
"b25Hcm91cBI2CgZhcm1vcnMYASADKAsyJi5ibGl0emtpdC5QZW5ldHJhdGlv",
|
||||
"bkdyb3VwLkFybW9yc0VudHJ5Gi0KC0FybW9yc0VudHJ5EgsKA2tleRgBIAEo",
|
||||
"CRINCgV2YWx1ZRgCIAEoAjoCOAE="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { global::Blitzkit.I18NReflection.Descriptor, },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tank), global::Blitzkit.Tank.Parser, new[]{ "Id", "Slug", "Name" }, null, null, null, null)
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tank), global::Blitzkit.Tank.Parser, new[]{ "Id", "Slug", "Name", "PenetrationGroups" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.PenetrationGroup), global::Blitzkit.PenetrationGroup.Parser, new[]{ "Armors" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
@@ -76,6 +83,7 @@ namespace Blitzkit {
|
||||
id_ = other.id_;
|
||||
slug_ = other.slug_;
|
||||
name_ = other.name_ != null ? other.name_.Clone() : null;
|
||||
penetrationGroups_ = other.penetrationGroups_.Clone();
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -149,6 +157,20 @@ namespace Blitzkit {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "penetration_groups" field.</summary>
|
||||
public const int PenetrationGroupsFieldNumber = 4;
|
||||
private static readonly pbc::MapField<string, global::Blitzkit.PenetrationGroup>.Codec _map_penetrationGroups_codec
|
||||
= new pbc::MapField<string, global::Blitzkit.PenetrationGroup>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Blitzkit.PenetrationGroup.Parser), 34);
|
||||
private readonly pbc::MapField<string, global::Blitzkit.PenetrationGroup> penetrationGroups_ = new pbc::MapField<string, global::Blitzkit.PenetrationGroup>();
|
||||
/// <summary>
|
||||
/// key can only ever be "chassis", "hull", "turret", or "gun"
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::MapField<string, global::Blitzkit.PenetrationGroup> PenetrationGroups {
|
||||
get { return penetrationGroups_; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
@@ -167,6 +189,7 @@ namespace Blitzkit {
|
||||
if (Id != other.Id) return false;
|
||||
if (Slug != other.Slug) return false;
|
||||
if (!object.Equals(Name, other.Name)) return false;
|
||||
if (!PenetrationGroups.Equals(other.PenetrationGroups)) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -177,6 +200,7 @@ namespace Blitzkit {
|
||||
if (HasId) hash ^= Id.GetHashCode();
|
||||
if (HasSlug) hash ^= Slug.GetHashCode();
|
||||
if (name_ != null) hash ^= Name.GetHashCode();
|
||||
hash ^= PenetrationGroups.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
@@ -207,6 +231,7 @@ namespace Blitzkit {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteMessage(Name);
|
||||
}
|
||||
penetrationGroups_.WriteTo(output, _map_penetrationGroups_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
@@ -229,6 +254,7 @@ namespace Blitzkit {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteMessage(Name);
|
||||
}
|
||||
penetrationGroups_.WriteTo(ref output, _map_penetrationGroups_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
@@ -248,6 +274,7 @@ namespace Blitzkit {
|
||||
if (name_ != null) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Name);
|
||||
}
|
||||
size += penetrationGroups_.CalculateSize(_map_penetrationGroups_codec);
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
@@ -272,6 +299,7 @@ namespace Blitzkit {
|
||||
}
|
||||
Name.MergeFrom(other.Name);
|
||||
}
|
||||
penetrationGroups_.MergeFrom(other.penetrationGroups_);
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
@@ -306,6 +334,10 @@ namespace Blitzkit {
|
||||
input.ReadMessage(Name);
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
penetrationGroups_.AddEntriesFrom(input, _map_penetrationGroups_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -340,6 +372,197 @@ namespace Blitzkit {
|
||||
input.ReadMessage(Name);
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
penetrationGroups_.AddEntriesFrom(ref input, _map_penetrationGroups_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class PenetrationGroup : pb::IMessage<PenetrationGroup>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<PenetrationGroup> _parser = new pb::MessageParser<PenetrationGroup>(() => new PenetrationGroup());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<PenetrationGroup> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::Blitzkit.TankReflection.Descriptor.MessageTypes[1]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public PenetrationGroup() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public PenetrationGroup(PenetrationGroup other) : this() {
|
||||
armors_ = other.armors_.Clone();
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public PenetrationGroup Clone() {
|
||||
return new PenetrationGroup(this);
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "armors" field.</summary>
|
||||
public const int ArmorsFieldNumber = 1;
|
||||
private static readonly pbc::MapField<string, float>.Codec _map_armors_codec
|
||||
= new pbc::MapField<string, float>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForFloat(21, 0F), 10);
|
||||
private readonly pbc::MapField<string, float> armors_ = new pbc::MapField<string, float>();
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pbc::MapField<string, float> Armors {
|
||||
get { return armors_; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as PenetrationGroup);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(PenetrationGroup other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (!Armors.Equals(other.Armors)) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
hash ^= Armors.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
armors_.WriteTo(output, _map_armors_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
armors_.WriteTo(ref output, _map_armors_codec);
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
size += armors_.CalculateSize(_map_armors_codec);
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(PenetrationGroup other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
armors_.MergeFrom(other.armors_);
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
case 10: {
|
||||
armors_.AddEntriesFrom(input, _map_armors_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
case 10: {
|
||||
armors_.AddEntriesFrom(ref input, _map_armors_codec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user