gotta go fast

This commit is contained in:
tresabhi committed 2025-03-18 17:26:09 -05:00
1 parent 35894f39cf
commit 57d63ea1d7
9 files changed
+368 -668

No files matched your search

+30 -67
View File
@@ -5,9 +5,9 @@
// source: packages/core/src/protos/i18n.proto // source: packages/core/src/protos/i18n.proto
/* eslint-disable */ /* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = 'blitzkit'; export const protobufPackage = "blitzkit";
export interface I18n { export interface I18n {
locales: { [key: string]: string }; locales: { [key: string]: string };
@@ -18,27 +18,20 @@ export interface I18n_LocalesEntry {
value: string; value: string;
} }
export function createBaseI18n(): I18n { function createBaseI18n(): I18n {
return { locales: {} }; return { locales: {} };
} }
export const I18n: MessageFns<I18n> = { export const I18n: MessageFns<I18n> = {
encode( encode(message: I18n, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: I18n,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.locales).forEach(([key, value]) => { Object.entries(message.locales).forEach(([key, value]) => {
I18n_LocalesEntry.encode( I18n_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
}); });
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): I18n { decode(input: BinaryReader | Uint8Array, length?: number): I18n {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n(); const message = createBaseI18n();
while (reader.pos < end) { while (reader.pos < end) {
@@ -67,13 +60,10 @@ export const I18n: MessageFns<I18n> = {
fromJSON(object: any): I18n { fromJSON(object: any): I18n {
return { return {
locales: isObject(object.locales) locales: isObject(object.locales)
? Object.entries(object.locales).reduce<{ [key: string]: string }>( ? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
(acc, [key, value]) => { acc[key] = String(value);
acc[key] = String(value); return acc;
return acc; }, {})
},
{},
)
: {}, : {},
}; };
}, },
@@ -97,9 +87,7 @@ export const I18n: MessageFns<I18n> = {
}, },
fromPartial<I extends Exact<DeepPartial<I18n>, I>>(object: I): I18n { fromPartial<I extends Exact<DeepPartial<I18n>, I>>(object: I): I18n {
const message = createBaseI18n(); const message = createBaseI18n();
message.locales = Object.entries(object.locales ?? {}).reduce<{ message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
[key: string]: string;
}>((acc, [key, value]) => {
if (value !== undefined) { if (value !== undefined) {
acc[key] = globalThis.String(value); acc[key] = globalThis.String(value);
} }
@@ -110,14 +98,11 @@ export const I18n: MessageFns<I18n> = {
}; };
function createBaseI18n_LocalesEntry(): I18n_LocalesEntry { function createBaseI18n_LocalesEntry(): I18n_LocalesEntry {
return { key: '', value: '' }; return { key: "", value: "" };
} }
export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = { export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
encode( encode(message: I18n_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: I18n_LocalesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) { if (message.key !== undefined) {
writer.uint32(10).string(message.key); writer.uint32(10).string(message.key);
} }
@@ -128,8 +113,7 @@ export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
}, },
decode(input: BinaryReader | Uint8Array, length?: number): I18n_LocalesEntry { decode(input: BinaryReader | Uint8Array, length?: number): I18n_LocalesEntry {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n_LocalesEntry(); const message = createBaseI18n_LocalesEntry();
while (reader.pos < end) { while (reader.pos < end) {
@@ -162,10 +146,8 @@ export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
fromJSON(object: any): I18n_LocalesEntry { fromJSON(object: any): I18n_LocalesEntry {
return { return {
key: globalThis.String(assertSet('I18n_LocalesEntry.key', object.key)), key: globalThis.String(assertSet("I18n_LocalesEntry.key", object.key)),
value: globalThis.String( value: globalThis.String(assertSet("I18n_LocalesEntry.value", object.value)),
assertSet('I18n_LocalesEntry.value', object.value),
),
}; };
}, },
@@ -180,51 +162,32 @@ export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>( create<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(base?: I): I18n_LocalesEntry {
base?: I,
): I18n_LocalesEntry {
return I18n_LocalesEntry.fromPartial(base ?? ({} as any)); return I18n_LocalesEntry.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>( fromPartial<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(object: I): I18n_LocalesEntry {
object: I,
): I18n_LocalesEntry {
const message = createBaseI18n_LocalesEntry(); const message = createBaseI18n_LocalesEntry();
message.key = object.key ?? ''; message.key = object.key ?? "";
message.value = object.value ?? ''; message.value = object.value ?? "";
return message; return message;
}, },
}; };
type Builtin = type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin export type DeepPartial<T> = T extends Builtin ? T
? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends globalThis.Array<infer U> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
? globalThis.Array<DeepPartial<U>> : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends ReadonlyArray<infer U> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
? ReadonlyArray<DeepPartial<U>> : Partial<T>;
: 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; type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin export type Exact<P, I extends P> = P extends Builtin ? P
? P : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean { function isObject(value: any): boolean {
return typeof value === 'object' && value !== null; return typeof value === "object" && value !== null;
} }
function isSet(value: any): boolean { function isSet(value: any): boolean {
@@ -5,10 +5,10 @@
// source: packages/core/src/protos/legacy_game_definitions.proto // source: packages/core/src/protos/legacy_game_definitions.proto
/* eslint-disable */ /* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from './legacy_i18n'; import { I18nString } from "./legacy_i18n";
export const protobufPackage = 'blitzkit'; export const protobufPackage = "blitzkit";
export interface GameDefinitions { export interface GameDefinitions {
version: string; version: string;
@@ -37,38 +37,28 @@ export interface GameModeRole {
} }
function createBaseGameDefinitions(): GameDefinitions { function createBaseGameDefinitions(): GameDefinitions {
return { version: '', nations: [], gameModes: {}, roles: {} }; return { version: "", nations: [], gameModes: {}, roles: {} };
} }
export const GameDefinitions: MessageFns<GameDefinitions> = { export const GameDefinitions: MessageFns<GameDefinitions> = {
encode( encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: GameDefinitions, if (message.version !== "") {
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.version !== '') {
writer.uint32(10).string(message.version); writer.uint32(10).string(message.version);
} }
for (const v of message.nations) { for (const v of message.nations) {
writer.uint32(18).string(v!); writer.uint32(18).string(v!);
} }
Object.entries(message.gameModes).forEach(([key, value]) => { Object.entries(message.gameModes).forEach(([key, value]) => {
GameDefinitions_GameModesEntry.encode( GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
{ key: key as any, value },
writer.uint32(26).fork(),
).join();
}); });
Object.entries(message.roles).forEach(([key, value]) => { Object.entries(message.roles).forEach(([key, value]) => {
GameDefinitions_RolesEntry.encode( GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
{ key: key as any, value },
writer.uint32(34).fork(),
).join();
}); });
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions { decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions(); const message = createBaseGameDefinitions();
while (reader.pos < end) { while (reader.pos < end) {
@@ -95,10 +85,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break; break;
} }
const entry3 = GameDefinitions_GameModesEntry.decode( const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
reader,
reader.uint32(),
);
if (entry3.value !== undefined) { if (entry3.value !== undefined) {
message.gameModes[entry3.key] = entry3.value; message.gameModes[entry3.key] = entry3.value;
} }
@@ -109,10 +96,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break; break;
} }
const entry4 = GameDefinitions_RolesEntry.decode( const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
reader,
reader.uint32(),
);
if (entry4.value !== undefined) { if (entry4.value !== undefined) {
message.roles[entry4.key] = entry4.value; message.roles[entry4.key] = entry4.value;
} }
@@ -129,36 +113,26 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
fromJSON(object: any): GameDefinitions { fromJSON(object: any): GameDefinitions {
return { return {
version: globalThis.String( version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
assertSet('GameDefinitions.version', object.version), nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
),
nations: globalThis.Array.isArray(object?.nations)
? object.nations.map((e: any) => globalThis.String(e))
: [],
gameModes: isObject(object.gameModes) gameModes: isObject(object.gameModes)
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>( ? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
(acc, [key, value]) => { acc[globalThis.Number(key)] = GameMode.fromJSON(value);
acc[globalThis.Number(key)] = GameMode.fromJSON(value); return acc;
return acc; }, {})
},
{},
)
: {}, : {},
roles: isObject(object.roles) roles: isObject(object.roles)
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>( ? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
(acc, [key, value]) => { acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value); return acc;
return acc; }, {})
},
{},
)
: {}, : {},
}; };
}, },
toJSON(message: GameDefinitions): unknown { toJSON(message: GameDefinitions): unknown {
const obj: any = {}; const obj: any = {};
if (message.version !== '') { if (message.version !== "") {
obj.version = message.version; obj.version = message.version;
} }
if (message.nations?.length) { if (message.nations?.length) {
@@ -185,28 +159,23 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<GameDefinitions>, I>>( create<I extends Exact<DeepPartial<GameDefinitions>, I>>(base?: I): GameDefinitions {
base?: I,
): GameDefinitions {
return GameDefinitions.fromPartial(base ?? ({} as any)); return GameDefinitions.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>( fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
object: I,
): GameDefinitions {
const message = createBaseGameDefinitions(); const message = createBaseGameDefinitions();
message.version = object.version ?? ''; message.version = object.version ?? "";
message.nations = object.nations?.map((e) => e) || []; message.nations = object.nations?.map((e) => e) || [];
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
[key: number]: GameMode; (acc, [key, value]) => {
}>((acc, [key, value]) => { if (value !== undefined) {
if (value !== undefined) { acc[globalThis.Number(key)] = GameMode.fromPartial(value);
acc[globalThis.Number(key)] = GameMode.fromPartial(value); }
} return acc;
return acc; },
}, {}); {},
message.roles = Object.entries(object.roles ?? {}).reduce<{ );
[key: number]: GameModeRole; message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
}>((acc, [key, value]) => {
if (value !== undefined) { if (value !== undefined) {
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value); acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
} }
@@ -220,201 +189,166 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn
return { key: 0, value: createBaseGameMode() }; return { key: 0, value: createBaseGameMode() };
} }
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
{ encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode( if (message.key !== undefined) {
message: GameDefinitions_GameModesEntry, writer.uint32(8).uint32(message.key);
writer: BinaryWriter = new BinaryWriter(), }
): BinaryWriter { if (message.value !== undefined) {
if (message.key !== undefined) { GameMode.encode(message.value, writer.uint32(18).fork()).join();
writer.uint32(8).uint32(message.key); }
} return writer;
if (message.value !== undefined) { },
GameMode.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode( decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
input: BinaryReader | Uint8Array, const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
length?: number, let end = length === undefined ? reader.len : reader.pos + length;
): GameDefinitions_GameModesEntry { const message = createBaseGameDefinitions_GameModesEntry();
const reader = while (reader.pos < end) {
input instanceof BinaryReader ? input : new BinaryReader(input); const tag = reader.uint32();
let end = length === undefined ? reader.len : reader.pos + length; switch (tag >>> 3) {
const message = createBaseGameDefinitions_GameModesEntry(); case 1: {
while (reader.pos < end) { if (tag !== 8) {
const tag = reader.uint32(); break;
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
} }
case 2: {
if (tag !== 18) {
break;
}
message.value = GameMode.decode(reader, reader.uint32()); message.key = reader.uint32();
continue; 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; if ((tag & 7) === 4 || tag === 0) {
}, break;
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) { reader.skip(tag & 7);
obj.value = GameMode.toJSON(message.value); }
} return message;
return obj; },
},
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>( fromJSON(object: any): GameDefinitions_GameModesEntry {
base?: I, return {
): GameDefinitions_GameModesEntry { key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any)); value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
}, };
fromPartial< },
I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>,
>(object: I): GameDefinitions_GameModesEntry { toJSON(message: GameDefinitions_GameModesEntry): unknown {
const message = createBaseGameDefinitions_GameModesEntry(); const obj: any = {};
message.key = object.key ?? 0; if (message.key !== undefined) {
message.value = obj.key = Math.round(message.key);
object.value !== undefined && object.value !== null }
? GameMode.fromPartial(object.value) if (message.value !== undefined) {
: undefined; obj.value = GameMode.toJSON(message.value);
return message; }
}, 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 { function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
return { key: 0, value: createBaseGameModeRole() }; return { key: 0, value: createBaseGameModeRole() };
} }
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
{ encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode( if (message.key !== undefined) {
message: GameDefinitions_RolesEntry, writer.uint32(8).uint32(message.key);
writer: BinaryWriter = new BinaryWriter(), }
): BinaryWriter { if (message.value !== undefined) {
if (message.key !== undefined) { GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
writer.uint32(8).uint32(message.key); }
} return writer;
if (message.value !== undefined) { },
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode( decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
input: BinaryReader | Uint8Array, const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
length?: number, let end = length === undefined ? reader.len : reader.pos + length;
): GameDefinitions_RolesEntry { const message = createBaseGameDefinitions_RolesEntry();
const reader = while (reader.pos < end) {
input instanceof BinaryReader ? input : new BinaryReader(input); const tag = reader.uint32();
let end = length === undefined ? reader.len : reader.pos + length; switch (tag >>> 3) {
const message = createBaseGameDefinitions_RolesEntry(); case 1: {
while (reader.pos < end) { if (tag !== 8) {
const tag = reader.uint32(); break;
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
} }
case 2: {
if (tag !== 18) {
break;
}
message.value = GameModeRole.decode(reader, reader.uint32()); message.key = reader.uint32();
continue; 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; if ((tag & 7) === 4 || tag === 0) {
}, break;
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) { reader.skip(tag & 7);
obj.value = GameModeRole.toJSON(message.value); }
} return message;
return obj; },
},
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>( fromJSON(object: any): GameDefinitions_RolesEntry {
base?: I, return {
): GameDefinitions_RolesEntry { key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any)); value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
}, };
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>( },
object: I,
): GameDefinitions_RolesEntry { toJSON(message: GameDefinitions_RolesEntry): unknown {
const message = createBaseGameDefinitions_RolesEntry(); const obj: any = {};
message.key = object.key ?? 0; if (message.key !== undefined) {
message.value = obj.key = Math.round(message.key);
object.value !== undefined && object.value !== null }
? GameModeRole.fromPartial(object.value) if (message.value !== undefined) {
: undefined; obj.value = GameModeRole.toJSON(message.value);
return message; }
}, 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 { function createBaseGameMode(): GameMode {
return { name: createBaseI18nString() }; return { name: createBaseI18nString() };
} }
export const GameMode: MessageFns<GameMode> = { export const GameMode: MessageFns<GameMode> = {
encode( encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: GameMode,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== undefined) { if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join(); I18nString.encode(message.name, writer.uint32(10).fork()).join();
} }
@@ -422,8 +356,7 @@ export const GameMode: MessageFns<GameMode> = {
}, },
decode(input: BinaryReader | Uint8Array, length?: number): GameMode { decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameMode(); const message = createBaseGameMode();
while (reader.pos < end) { while (reader.pos < end) {
@@ -447,9 +380,7 @@ export const GameMode: MessageFns<GameMode> = {
}, },
fromJSON(object: any): GameMode { fromJSON(object: any): GameMode {
return { return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) };
name: I18nString.fromJSON(assertSet('GameMode.name', object.name)),
};
}, },
toJSON(message: GameMode): unknown { toJSON(message: GameMode): unknown {
@@ -465,10 +396,9 @@ export const GameMode: MessageFns<GameMode> = {
}, },
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode { fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
const message = createBaseGameMode(); const message = createBaseGameMode();
message.name = message.name = (object.name !== undefined && object.name !== null)
object.name !== undefined && object.name !== null ? I18nString.fromPartial(object.name)
? I18nString.fromPartial(object.name) : createBaseI18nString();
: createBaseI18nString();
return message; return message;
}, },
}; };
@@ -478,10 +408,7 @@ function createBaseGameModeRole(): GameModeRole {
} }
export const GameModeRole: MessageFns<GameModeRole> = { export const GameModeRole: MessageFns<GameModeRole> = {
encode( encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: GameModeRole,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
writer.uint32(10).fork(); writer.uint32(10).fork();
for (const v of message.provisions) { for (const v of message.provisions) {
writer.uint32(v); writer.uint32(v);
@@ -496,8 +423,7 @@ export const GameModeRole: MessageFns<GameModeRole> = {
}, },
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole { decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameModeRole(); const message = createBaseGameModeRole();
while (reader.pos < end) { while (reader.pos < end) {
@@ -570,14 +496,10 @@ export const GameModeRole: MessageFns<GameModeRole> = {
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<GameModeRole>, I>>( create<I extends Exact<DeepPartial<GameModeRole>, I>>(base?: I): GameModeRole {
base?: I,
): GameModeRole {
return GameModeRole.fromPartial(base ?? ({} as any)); return GameModeRole.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>( fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
object: I,
): GameModeRole {
const message = createBaseGameModeRole(); const message = createBaseGameModeRole();
message.provisions = object.provisions?.map((e) => e) || []; message.provisions = object.provisions?.map((e) => e) || [];
message.consumables = object.consumables?.map((e) => e) || []; message.consumables = object.consumables?.map((e) => e) || [];
@@ -585,36 +507,21 @@ export const GameModeRole: MessageFns<GameModeRole> = {
}, },
}; };
type Builtin = type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin export type DeepPartial<T> = T extends Builtin ? T
? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends globalThis.Array<infer U> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
? globalThis.Array<DeepPartial<U>> : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends ReadonlyArray<infer U> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
? ReadonlyArray<DeepPartial<U>> : Partial<T>;
: 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; type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin export type Exact<P, I extends P> = P extends Builtin ? P
? P : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean { function isObject(value: any): boolean {
return typeof value === 'object' && value !== null; return typeof value === "object" && value !== null;
} }
function isSet(value: any): boolean { function isSet(value: any): boolean {
+33 -80
View File
@@ -5,9 +5,9 @@
// source: packages/core/src/protos/legacy_i18n.proto // source: packages/core/src/protos/legacy_i18n.proto
/* eslint-disable */ /* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = 'blitzkit'; export const protobufPackage = "blitzkit";
export interface I18nString { export interface I18nString {
locales: { [key: string]: string }; locales: { [key: string]: string };
@@ -18,27 +18,20 @@ export interface I18nString_LocalesEntry {
value: string; value: string;
} }
export function createBaseI18nString(): I18nString { function createBaseI18nString(): I18nString {
return { locales: {} }; return { locales: {} };
} }
export const I18nString: MessageFns<I18nString> = { export const I18nString: MessageFns<I18nString> = {
encode( encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: I18nString,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.locales).forEach(([key, value]) => { Object.entries(message.locales).forEach(([key, value]) => {
I18nString_LocalesEntry.encode( I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
}); });
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): I18nString { decode(input: BinaryReader | Uint8Array, length?: number): I18nString {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18nString(); const message = createBaseI18nString();
while (reader.pos < end) { while (reader.pos < end) {
@@ -49,10 +42,7 @@ export const I18nString: MessageFns<I18nString> = {
break; break;
} }
const entry1 = I18nString_LocalesEntry.decode( const entry1 = I18nString_LocalesEntry.decode(reader, reader.uint32());
reader,
reader.uint32(),
);
if (entry1.value !== undefined) { if (entry1.value !== undefined) {
message.locales[entry1.key] = entry1.value; message.locales[entry1.key] = entry1.value;
} }
@@ -70,13 +60,10 @@ export const I18nString: MessageFns<I18nString> = {
fromJSON(object: any): I18nString { fromJSON(object: any): I18nString {
return { return {
locales: isObject(object.locales) locales: isObject(object.locales)
? Object.entries(object.locales).reduce<{ [key: string]: string }>( ? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
(acc, [key, value]) => { acc[key] = String(value);
acc[key] = String(value); return acc;
return acc; }, {})
},
{},
)
: {}, : {},
}; };
}, },
@@ -98,13 +85,9 @@ export const I18nString: MessageFns<I18nString> = {
create<I extends Exact<DeepPartial<I18nString>, I>>(base?: I): I18nString { create<I extends Exact<DeepPartial<I18nString>, I>>(base?: I): I18nString {
return I18nString.fromPartial(base ?? ({} as any)); return I18nString.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>( fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
object: I,
): I18nString {
const message = createBaseI18nString(); const message = createBaseI18nString();
message.locales = Object.entries(object.locales ?? {}).reduce<{ message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
[key: string]: string;
}>((acc, [key, value]) => {
if (value !== undefined) { if (value !== undefined) {
acc[key] = globalThis.String(value); acc[key] = globalThis.String(value);
} }
@@ -115,14 +98,11 @@ export const I18nString: MessageFns<I18nString> = {
}; };
function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry { function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry {
return { key: '', value: '' }; return { key: "", value: "" };
} }
export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = { export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
encode( encode(message: I18nString_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: I18nString_LocalesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) { if (message.key !== undefined) {
writer.uint32(10).string(message.key); writer.uint32(10).string(message.key);
} }
@@ -132,12 +112,8 @@ export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
return writer; return writer;
}, },
decode( decode(input: BinaryReader | Uint8Array, length?: number): I18nString_LocalesEntry {
input: BinaryReader | Uint8Array, const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
length?: number,
): I18nString_LocalesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18nString_LocalesEntry(); const message = createBaseI18nString_LocalesEntry();
while (reader.pos < end) { while (reader.pos < end) {
@@ -170,12 +146,8 @@ export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
fromJSON(object: any): I18nString_LocalesEntry { fromJSON(object: any): I18nString_LocalesEntry {
return { return {
key: globalThis.String( key: globalThis.String(assertSet("I18nString_LocalesEntry.key", object.key)),
assertSet('I18nString_LocalesEntry.key', object.key), value: globalThis.String(assertSet("I18nString_LocalesEntry.value", object.value)),
),
value: globalThis.String(
assertSet('I18nString_LocalesEntry.value', object.value),
),
}; };
}, },
@@ -190,51 +162,32 @@ export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>( create<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>(base?: I): I18nString_LocalesEntry {
base?: I,
): I18nString_LocalesEntry {
return I18nString_LocalesEntry.fromPartial(base ?? ({} as any)); return I18nString_LocalesEntry.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>( fromPartial<I extends Exact<DeepPartial<I18nString_LocalesEntry>, I>>(object: I): I18nString_LocalesEntry {
object: I,
): I18nString_LocalesEntry {
const message = createBaseI18nString_LocalesEntry(); const message = createBaseI18nString_LocalesEntry();
message.key = object.key ?? ''; message.key = object.key ?? "";
message.value = object.value ?? ''; message.value = object.value ?? "";
return message; return message;
}, },
}; };
type Builtin = type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin export type DeepPartial<T> = T extends Builtin ? T
? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends globalThis.Array<infer U> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
? globalThis.Array<DeepPartial<U>> : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends ReadonlyArray<infer U> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
? ReadonlyArray<DeepPartial<U>> : Partial<T>;
: 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; type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin export type Exact<P, I extends P> = P extends Builtin ? P
? P : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean { function isObject(value: any): boolean {
return typeof value === 'object' && value !== null; return typeof value === "object" && value !== null;
} }
function isSet(value: any): boolean { function isSet(value: any): boolean {
+27 -47
View File
@@ -5,10 +5,10 @@
// source: packages/core/src/protos/tank.proto // source: packages/core/src/protos/tank.proto
/* eslint-disable */ /* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18n, createBaseI18n } from './i18n'; import { I18n } from "./i18n";
export const protobufPackage = 'blitzkit'; export const protobufPackage = "blitzkit";
export interface Tank { export interface Tank {
id: string; id: string;
@@ -17,18 +17,15 @@ export interface Tank {
} }
function createBaseTank(): Tank { function createBaseTank(): Tank {
return { id: '', slug: '', name: createBaseI18n() }; return { id: "", slug: "", name: createBaseI18n() };
} }
export const Tank: MessageFns<Tank> = { export const Tank: MessageFns<Tank> = {
encode( encode(message: Tank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
message: Tank, if (message.id !== "") {
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== '') {
writer.uint32(10).string(message.id); writer.uint32(10).string(message.id);
} }
if (message.slug !== '') { if (message.slug !== "") {
writer.uint32(18).string(message.slug); writer.uint32(18).string(message.slug);
} }
if (message.name !== undefined) { if (message.name !== undefined) {
@@ -38,8 +35,7 @@ export const Tank: MessageFns<Tank> = {
}, },
decode(input: BinaryReader | Uint8Array, length?: number): Tank { decode(input: BinaryReader | Uint8Array, length?: number): Tank {
const reader = const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank(); const message = createBaseTank();
while (reader.pos < end) { while (reader.pos < end) {
@@ -80,18 +76,18 @@ export const Tank: MessageFns<Tank> = {
fromJSON(object: any): Tank { fromJSON(object: any): Tank {
return { return {
id: globalThis.String(assertSet('Tank.id', object.id)), id: globalThis.String(assertSet("Tank.id", object.id)),
slug: globalThis.String(assertSet('Tank.slug', object.slug)), slug: globalThis.String(assertSet("Tank.slug", object.slug)),
name: I18n.fromJSON(assertSet('Tank.name', object.name)), name: I18n.fromJSON(assertSet("Tank.name", object.name)),
}; };
}, },
toJSON(message: Tank): unknown { toJSON(message: Tank): unknown {
const obj: any = {}; const obj: any = {};
if (message.id !== '') { if (message.id !== "") {
obj.id = message.id; obj.id = message.id;
} }
if (message.slug !== '') { if (message.slug !== "") {
obj.slug = message.slug; obj.slug = message.slug;
} }
if (message.name !== undefined) { if (message.name !== undefined) {
@@ -105,43 +101,27 @@ export const Tank: MessageFns<Tank> = {
}, },
fromPartial<I extends Exact<DeepPartial<Tank>, I>>(object: I): Tank { fromPartial<I extends Exact<DeepPartial<Tank>, I>>(object: I): Tank {
const message = createBaseTank(); const message = createBaseTank();
message.id = object.id ?? ''; message.id = object.id ?? "";
message.slug = object.slug ?? ''; message.slug = object.slug ?? "";
message.name = message.name = (object.name !== undefined && object.name !== null)
object.name !== undefined && object.name !== null ? I18n.fromPartial(object.name)
? I18n.fromPartial(object.name) : createBaseI18n();
: createBaseI18n();
return message; return message;
}, },
}; };
type Builtin = type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin export type DeepPartial<T> = T extends Builtin ? T
? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends globalThis.Array<infer U> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
? globalThis.Array<DeepPartial<U>> : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends ReadonlyArray<infer U> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
? ReadonlyArray<DeepPartial<U>> : Partial<T>;
: 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; type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin export type Exact<P, I extends P> = P extends Builtin ? P
? P : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isSet(value: any): boolean { function isSet(value: any): boolean {
return value !== null && value !== undefined; return value !== null && value !== undefined;
+5 -4
View File
@@ -1,12 +1,13 @@
syntax = "proto2"; syntax = "proto2";
import "packages/core/src/protos/tank.proto";
package blitzkit; package blitzkit;
message Tanks { message Tanks {
repeated TankMeta tanks = 1; repeated string tanks = 1;
} }
message TankMeta { message TanksFull {
required string id = 1; repeated Tank tanks = 1;
required string slug = 2;
} }
+28 -58
View File
@@ -6,16 +6,16 @@
/* eslint-disable */ /* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Tank } from "./tank";
export const protobufPackage = "blitzkit"; export const protobufPackage = "blitzkit";
export interface Tanks { export interface Tanks {
tanks: TankMeta[]; tanks: string[];
} }
export interface TankMeta { export interface TanksFull {
id: string; tanks: Tank[];
slug: string;
} }
function createBaseTanks(): Tanks { function createBaseTanks(): Tanks {
@@ -25,7 +25,7 @@ function createBaseTanks(): Tanks {
export const Tanks: MessageFns<Tanks> = { export const Tanks: MessageFns<Tanks> = {
encode(message: Tanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: Tanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) { for (const v of message.tanks) {
TankMeta.encode(v!, writer.uint32(10).fork()).join(); writer.uint32(10).string(v!);
} }
return writer; return writer;
}, },
@@ -42,7 +42,7 @@ export const Tanks: MessageFns<Tanks> = {
break; break;
} }
message.tanks.push(TankMeta.decode(reader, reader.uint32())); message.tanks.push(reader.string());
continue; continue;
} }
} }
@@ -55,13 +55,13 @@ export const Tanks: MessageFns<Tanks> = {
}, },
fromJSON(object: any): Tanks { fromJSON(object: any): Tanks {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => TankMeta.fromJSON(e)) : [] }; return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => globalThis.String(e)) : [] };
}, },
toJSON(message: Tanks): unknown { toJSON(message: Tanks): unknown {
const obj: any = {}; const obj: any = {};
if (message.tanks?.length) { if (message.tanks?.length) {
obj.tanks = message.tanks.map((e) => TankMeta.toJSON(e)); obj.tanks = message.tanks;
} }
return obj; return obj;
}, },
@@ -71,30 +71,27 @@ export const Tanks: MessageFns<Tanks> = {
}, },
fromPartial<I extends Exact<DeepPartial<Tanks>, I>>(object: I): Tanks { fromPartial<I extends Exact<DeepPartial<Tanks>, I>>(object: I): Tanks {
const message = createBaseTanks(); const message = createBaseTanks();
message.tanks = object.tanks?.map((e) => TankMeta.fromPartial(e)) || []; message.tanks = object.tanks?.map((e) => e) || [];
return message; return message;
}, },
}; };
function createBaseTankMeta(): TankMeta { function createBaseTanksFull(): TanksFull {
return { id: "", slug: "" }; return { tanks: [] };
} }
export const TankMeta: MessageFns<TankMeta> = { export const TanksFull: MessageFns<TanksFull> = {
encode(message: TankMeta, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: TanksFull, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") { for (const v of message.tanks) {
writer.uint32(10).string(message.id); Tank.encode(v!, writer.uint32(10).fork()).join();
}
if (message.slug !== "") {
writer.uint32(18).string(message.slug);
} }
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): TankMeta { decode(input: BinaryReader | Uint8Array, length?: number): TanksFull {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankMeta(); const message = createBaseTanksFull();
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
@@ -103,15 +100,7 @@ export const TankMeta: MessageFns<TankMeta> = {
break; break;
} }
message.id = reader.string(); message.tanks.push(Tank.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.slug = reader.string();
continue; continue;
} }
} }
@@ -123,31 +112,24 @@ export const TankMeta: MessageFns<TankMeta> = {
return message; return message;
}, },
fromJSON(object: any): TankMeta { fromJSON(object: any): TanksFull {
return { return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => Tank.fromJSON(e)) : [] };
id: globalThis.String(assertSet("TankMeta.id", object.id)),
slug: globalThis.String(assertSet("TankMeta.slug", object.slug)),
};
}, },
toJSON(message: TankMeta): unknown { toJSON(message: TanksFull): unknown {
const obj: any = {}; const obj: any = {};
if (message.id !== "") { if (message.tanks?.length) {
obj.id = message.id; obj.tanks = message.tanks.map((e) => Tank.toJSON(e));
}
if (message.slug !== "") {
obj.slug = message.slug;
} }
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<TankMeta>, I>>(base?: I): TankMeta { create<I extends Exact<DeepPartial<TanksFull>, I>>(base?: I): TanksFull {
return TankMeta.fromPartial(base ?? ({} as any)); return TanksFull.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<TankMeta>, I>>(object: I): TankMeta { fromPartial<I extends Exact<DeepPartial<TanksFull>, I>>(object: I): TanksFull {
const message = createBaseTankMeta(); const message = createBaseTanksFull();
message.id = object.id ?? ""; message.tanks = object.tanks?.map((e) => Tank.fromPartial(e)) || [];
message.slug = object.slug ?? "";
return message; return message;
}, },
}; };
@@ -165,18 +147,6 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never }; : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> { export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter; encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T; decode(input: BinaryReader | Uint8Array, length?: number): T;
+16 -20
View File
@@ -84,7 +84,7 @@ namespace BlitzKit.CLI.Functions
async Task MangleNations() async Task MangleNations()
{ {
var dirs = provider.RootDirectory.GetDirectory("Blitz/Content/Tanks").Directories; var dirs = provider.RootDirectory.GetDirectory("Blitz/Content/Tanks").Directories;
List<Tank> tanksRaw = []; TanksFull tanksFull = new();
foreach (var dir in dirs) foreach (var dir in dirs)
{ {
@@ -97,36 +97,36 @@ namespace BlitzKit.CLI.Functions
// continue; // continue;
var tank = await MangleTank(tankDir.Value); var tank = await MangleTank(tankDir.Value);
tanksRaw.Add(tank); tanksFull.Tanks.Add(tank);
} }
} }
DeduplicateSlugs(tanksRaw); DeduplicateSlugs(tanksFull);
Tanks tanks = new(); Tanks tanks = new();
foreach (var tank in tanksRaw) foreach (var tank in tanksFull.Tanks)
{ {
TankMeta tankMeta = new() { Id = tank.Id, Slug = tank.Slug }; tanks.Tanks_.Add(tank.Id);
tanks.Tanks_.Add(tankMeta); await assetUploader.Add(new($"tanks/{tank.Id}/meta.pb", tank.ToByteArray()));
} }
await assetUploader.Add(new("definitions/tanks.pb", tanks.ToByteArray())); await assetUploader.Add(new("definitions/tanks.pb", tanks.ToByteArray()));
await assetUploader.Add(new("definitions/tanks-full.pb", tanksFull.ToByteArray()));
} }
void DeduplicateSlugs(List<Tank> tanks) void DeduplicateSlugs(TanksFull tanksFull)
{ {
List<string> checkedSlugs = []; List<string> checkedSlugs = [];
Dictionary<string, List<Tank>> duplicates = []; Dictionary<string, List<Tank>> duplicates = [];
foreach (var tank in tanks) foreach (var tank in tanksFull.Tanks)
{ {
if (checkedSlugs.Contains(tank.Slug)) if (checkedSlugs.Contains(tank.Slug))
continue; continue;
checkedSlugs.Add(tank.Slug); checkedSlugs.Add(tank.Slug);
foreach (var otherTank in tanks) foreach (var otherTank in tanksFull.Tanks)
{ {
if (otherTank.Slug.Equals(tank.Slug) && !otherTank.Id.Equals(tank.Id)) if (otherTank.Slug.Equals(tank.Slug) && !otherTank.Id.Equals(tank.Id))
{ {
@@ -150,20 +150,14 @@ namespace BlitzKit.CLI.Functions
Console.WriteLine($"\t{tank.Id}"); Console.WriteLine($"\t{tank.Id}");
} }
if (duplicate.Value.Count != 2) if (duplicate.Value.Count == 2 && duplicate.Value.Any(tank => tank.Id.EndsWith("TU")))
{
throw new Exception(
$"Found an unsupported {duplicate.Value.Count} duplicates for {duplicate.Key}"
);
}
if (duplicate.Value.Any(tank => tank.Id.EndsWith("TU")))
{ {
PrettyLog.Success("\tTutorial bot discrimination..."); PrettyLog.Success("\tTutorial bot discrimination...");
var tutorialBot = duplicate.Value.First(tank => tank.Id.EndsWith("TU")); var tutorialBot = duplicate.Value.First(tank => tank.Id.EndsWith("TU"));
tutorialBot.Slug += "-tu"; tutorialBot.Slug += "-tu";
} }
// if (duplicate.Value.All((tank)=>duplicate.Value.All((otherTank)=>otherTank.Id == tank.Id || otherTank.Nation != tank.Nation)))
else else
{ {
PrettyLog.Success("\tNation discrimination..."); PrettyLog.Success("\tNation discrimination...");
@@ -176,6 +170,10 @@ namespace BlitzKit.CLI.Functions
tank.Slug += $"-{slugNation}"; tank.Slug += $"-{slugNation}";
} }
} }
// else
// {
// throw new Exception("No applicable strategy found");
// }
foreach (var tank in duplicate.Value) foreach (var tank in duplicate.Value)
{ {
@@ -208,8 +206,6 @@ namespace BlitzKit.CLI.Functions
Slug = slug, Slug = slug,
}; };
await assetUploader.Add(new($"tanks/{id}/meta.pb", tank.ToByteArray()));
return tank; return tank;
} }
+7 -2
View File
@@ -13,6 +13,7 @@ namespace BlitzKit.CLI.Models
private static readonly int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000; private static readonly int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000;
private static readonly int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9); private static readonly int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9);
private static readonly int MAX_TREE_SIZE = 7_000_000; // 7MB private static readonly int MAX_TREE_SIZE = 7_000_000; // 7MB
private static readonly bool devMinimizeChecks = Env.GetBool("DEV_MINIMIZE_ASSET_CHECKS");
private readonly GitHubClient octokit = new(new ProductHeaderValue("MyAmazingApp")) private readonly GitHubClient octokit = new(new ProductHeaderValue("MyAmazingApp"))
{ {
@@ -40,10 +41,14 @@ namespace BlitzKit.CLI.Models
); );
changes.Add(change); changes.Add(change);
} }
else if (devMinimizeChecks)
{
return;
}
else if (response.StatusCode == HttpStatusCode.OK) else if (response.StatusCode == HttpStatusCode.OK)
{ {
int deltaSize = 0; int deltaSize;
bool isDifferent = false; bool isDifferent;
// hopefully they just give you the file size to delta from // hopefully they just give you the file size to delta from
if (response.Content.Headers.ContentLength.HasValue) if (response.Content.Headers.ContentLength.HasValue)
+35 -110
View File
@@ -25,13 +25,14 @@ namespace Blitzkit {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat( string.Concat(
"CiRwYWNrYWdlcy9jb3JlL3NyYy9wcm90b3MvdGFua3MucHJvdG8SCGJsaXR6", "CiRwYWNrYWdlcy9jb3JlL3NyYy9wcm90b3MvdGFua3MucHJvdG8SCGJsaXR6",
"a2l0IioKBVRhbmtzEiEKBXRhbmtzGAEgAygLMhIuYmxpdHpraXQuVGFua01l", "a2l0GiNwYWNrYWdlcy9jb3JlL3NyYy9wcm90b3MvdGFuay5wcm90byIWCgVU",
"dGEiJAoIVGFua01ldGESCgoCaWQYASACKAkSDAoEc2x1ZxgCIAIoCQ==")); "YW5rcxINCgV0YW5rcxgBIAMoCSIqCglUYW5rc0Z1bGwSHQoFdGFua3MYASAD",
"KAsyDi5ibGl0emtpdC5UYW5r"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { global::Blitzkit.TankReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tanks), global::Blitzkit.Tanks.Parser, new[]{ "Tanks_" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tanks), global::Blitzkit.Tanks.Parser, new[]{ "Tanks_" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.TankMeta), global::Blitzkit.TankMeta.Parser, new[]{ "Id", "Slug" }, null, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.TanksFull), global::Blitzkit.TanksFull.Parser, new[]{ "Tanks" }, null, null, null, null)
})); }));
} }
#endregion #endregion
@@ -85,12 +86,12 @@ namespace Blitzkit {
/// <summary>Field number for the "tanks" field.</summary> /// <summary>Field number for the "tanks" field.</summary>
public const int Tanks_FieldNumber = 1; public const int Tanks_FieldNumber = 1;
private static readonly pb::FieldCodec<global::Blitzkit.TankMeta> _repeated_tanks_codec private static readonly pb::FieldCodec<string> _repeated_tanks_codec
= pb::FieldCodec.ForMessage(10, global::Blitzkit.TankMeta.Parser); = pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<global::Blitzkit.TankMeta> tanks_ = new pbc::RepeatedField<global::Blitzkit.TankMeta>(); private readonly pbc::RepeatedField<string> tanks_ = new pbc::RepeatedField<string>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<global::Blitzkit.TankMeta> Tanks_ { public pbc::RepeatedField<string> Tanks_ {
get { return tanks_; } get { return tanks_; }
} }
@@ -226,16 +227,16 @@ namespace Blitzkit {
} }
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class TankMeta : pb::IMessage<TankMeta> public sealed partial class TanksFull : pb::IMessage<TanksFull>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage , pb::IBufferMessage
#endif #endif
{ {
private static readonly pb::MessageParser<TankMeta> _parser = new pb::MessageParser<TankMeta>(() => new TankMeta()); private static readonly pb::MessageParser<TanksFull> _parser = new pb::MessageParser<TanksFull>(() => new TanksFull());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<TankMeta> Parser { get { return _parser; } } public static pb::MessageParser<TanksFull> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -251,7 +252,7 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public TankMeta() { public TanksFull() {
OnConstruction(); OnConstruction();
} }
@@ -259,87 +260,44 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public TankMeta(TankMeta other) : this() { public TanksFull(TanksFull other) : this() {
id_ = other.id_; tanks_ = other.tanks_.Clone();
slug_ = other.slug_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public TankMeta Clone() { public TanksFull Clone() {
return new TankMeta(this); return new TanksFull(this);
} }
/// <summary>Field number for the "id" field.</summary> /// <summary>Field number for the "tanks" field.</summary>
public const int IdFieldNumber = 1; public const int TanksFieldNumber = 1;
private readonly static string IdDefaultValue = ""; private static readonly pb::FieldCodec<global::Blitzkit.Tank> _repeated_tanks_codec
= pb::FieldCodec.ForMessage(10, global::Blitzkit.Tank.Parser);
private string id_; private readonly pbc::RepeatedField<global::Blitzkit.Tank> tanks_ = new pbc::RepeatedField<global::Blitzkit.Tank>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Id { public pbc::RepeatedField<global::Blitzkit.Tank> Tanks {
get { return id_ ?? IdDefaultValue; } get { return tanks_; }
set {
id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "id" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool HasId {
get { return id_ != null; }
}
/// <summary>Clears the value of the "id" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearId() {
id_ = null;
}
/// <summary>Field number for the "slug" field.</summary>
public const int SlugFieldNumber = 2;
private readonly static string SlugDefaultValue = "";
private string slug_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Slug {
get { return slug_ ?? SlugDefaultValue; }
set {
slug_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "slug" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool HasSlug {
get { return slug_ != null; }
}
/// <summary>Clears the value of the "slug" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearSlug() {
slug_ = null;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as TankMeta); return Equals(other as TanksFull);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(TankMeta other) { public bool Equals(TanksFull other) {
if (ReferenceEquals(other, null)) { if (ReferenceEquals(other, null)) {
return false; return false;
} }
if (ReferenceEquals(other, this)) { if (ReferenceEquals(other, this)) {
return true; return true;
} }
if (Id != other.Id) return false; if(!tanks_.Equals(other.tanks_)) return false;
if (Slug != other.Slug) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@@ -347,8 +305,7 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (HasId) hash ^= Id.GetHashCode(); hash ^= tanks_.GetHashCode();
if (HasSlug) hash ^= Slug.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@@ -367,14 +324,7 @@ namespace Blitzkit {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this); output.WriteRawMessage(this);
#else #else
if (HasId) { tanks_.WriteTo(output, _repeated_tanks_codec);
output.WriteRawTag(10);
output.WriteString(Id);
}
if (HasSlug) {
output.WriteRawTag(18);
output.WriteString(Slug);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@@ -385,14 +335,7 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (HasId) { tanks_.WriteTo(ref output, _repeated_tanks_codec);
output.WriteRawTag(10);
output.WriteString(Id);
}
if (HasSlug) {
output.WriteRawTag(18);
output.WriteString(Slug);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(ref output); _unknownFields.WriteTo(ref output);
} }
@@ -403,12 +346,7 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (HasId) { size += tanks_.CalculateSize(_repeated_tanks_codec);
size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
}
if (HasSlug) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Slug);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@@ -417,16 +355,11 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(TankMeta other) { public void MergeFrom(TanksFull other) {
if (other == null) { if (other == null) {
return; return;
} }
if (other.HasId) { tanks_.Add(other.tanks_);
Id = other.Id;
}
if (other.HasSlug) {
Slug = other.Slug;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@@ -447,11 +380,7 @@ namespace Blitzkit {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break; break;
case 10: { case 10: {
Id = input.ReadString(); tanks_.AddEntriesFrom(input, _repeated_tanks_codec);
break;
}
case 18: {
Slug = input.ReadString();
break; break;
} }
} }
@@ -474,11 +403,7 @@ namespace Blitzkit {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break; break;
case 10: { case 10: {
Id = input.ReadString(); tanks_.AddEntriesFrom(ref input, _repeated_tanks_codec);
break;
}
case 18: {
Slug = input.ReadString();
break; break;
} }
} }