mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
add compatibility for string game mode ids
This commit is contained in:
1 parent
84f950ade4
commit
347efa75fe
22 files changed
+394
-740
No files matched your search
@@ -50,10 +50,11 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
|||||||
async tankDefinitions() {
|
async tankDefinitions() {
|
||||||
const tankDefinitions = TankDefinitions.create();
|
const tankDefinitions = TankDefinitions.create();
|
||||||
|
|
||||||
const gameModeNativeNames: Record<string, number> = {};
|
const gameModeNativeNames: Record<string, string> = {};
|
||||||
|
|
||||||
const squadBattleTypeGameModeNativeNameMatches =
|
const squadBattleTypeGameModeNativeNameMatches =
|
||||||
this.squadBattleTypeStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
this.squadBattleTypeStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
/"(\d+)" -> "(battleType\/([a-zA-Z]+))"/g,
|
/eGameMode\.(\w+) -> "(battleType\/([a-zA-Z]+))"/g,
|
||||||
);
|
);
|
||||||
const gameTypeGameModeNativeNameMatches =
|
const gameTypeGameModeNativeNameMatches =
|
||||||
this.gameTypeSelectorStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
this.gameTypeSelectorStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
@@ -61,8 +62,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const match of squadBattleTypeGameModeNativeNameMatches) {
|
for (const match of squadBattleTypeGameModeNativeNameMatches) {
|
||||||
const id = Number(match[1]);
|
gameModeNativeNames[match[3]] = match[1];
|
||||||
gameModeNativeNames[match[3]] = id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const match of gameTypeGameModeNativeNameMatches) {
|
for (const match of gameTypeGameModeNativeNameMatches) {
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ export abstract class ServerBlitzKitAPI9 extends ServerBlitzKitAPI8 {
|
|||||||
).available_nations;
|
).available_nations;
|
||||||
|
|
||||||
for (const match of this.squadBattleTypeStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
for (const match of this.squadBattleTypeStyles!.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
/"(\d+)" -> "(battleType\/([a-zA-Z]+))"/g,
|
/eGameMode\.(\w+) -> "(battleType\/([a-zA-Z]+))"/g,
|
||||||
)) {
|
)) {
|
||||||
const id = Number(match[1]);
|
const id = match[1];
|
||||||
const name = this.getString(match[2]);
|
const name = this.getString(match[2]);
|
||||||
|
|
||||||
gameDefinitions.gameModes[id] = {
|
gameDefinitions.gameModes[id] = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: average_definitions.proto
|
// source: average_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -64,7 +64,7 @@ function createBaseAverageDefinitions(): AverageDefinitions {
|
|||||||
|
|
||||||
export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
||||||
encode(message: AverageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: AverageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.averages).forEach(([key, value]: [string, AverageDefinitionsEntry]) => {
|
Object.entries(message.averages).forEach(([key, value]) => {
|
||||||
AverageDefinitions_AveragesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
AverageDefinitions_AveragesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
if (message.samples !== undefined) {
|
if (message.samples !== undefined) {
|
||||||
@@ -122,13 +122,10 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
fromJSON(object: any): AverageDefinitions {
|
fromJSON(object: any): AverageDefinitions {
|
||||||
return {
|
return {
|
||||||
averages: isObject(object.averages)
|
averages: isObject(object.averages)
|
||||||
? (globalThis.Object.entries(object.averages) as [string, any][]).reduce(
|
? Object.entries(object.averages).reduce<{ [key: number]: AverageDefinitionsEntry }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
||||||
time: isSet(object.time) ? globalThis.Number(object.time) : 0,
|
time: isSet(object.time) ? globalThis.Number(object.time) : 0,
|
||||||
@@ -138,7 +135,7 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
toJSON(message: AverageDefinitions): unknown {
|
toJSON(message: AverageDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.averages) {
|
if (message.averages) {
|
||||||
const entries = globalThis.Object.entries(message.averages) as [string, AverageDefinitionsEntry][];
|
const entries = Object.entries(message.averages);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.averages = {};
|
obj.averages = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -160,8 +157,8 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitions>, I>>(object: I): AverageDefinitions {
|
fromPartial<I extends Exact<DeepPartial<AverageDefinitions>, I>>(object: I): AverageDefinitions {
|
||||||
const message = createBaseAverageDefinitions();
|
const message = createBaseAverageDefinitions();
|
||||||
message.averages = (globalThis.Object.entries(object.averages ?? {}) as [string, AverageDefinitionsEntry][]).reduce(
|
message.averages = Object.entries(object.averages ?? {}).reduce<{ [key: number]: AverageDefinitionsEntry }>(
|
||||||
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, AverageDefinitionsEntry]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromPartial(value);
|
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -620,59 +617,25 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
fromJSON(object: any): AverageDefinitionsAllStats {
|
fromJSON(object: any): AverageDefinitionsAllStats {
|
||||||
return {
|
return {
|
||||||
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
||||||
capture_points: isSet(object.capturePoints)
|
capture_points: isSet(object.capture_points) ? globalThis.Number(object.capture_points) : 0,
|
||||||
? globalThis.Number(object.capturePoints)
|
damage_dealt: isSet(object.damage_dealt) ? globalThis.Number(object.damage_dealt) : 0,
|
||||||
: isSet(object.capture_points)
|
damage_received: isSet(object.damage_received) ? globalThis.Number(object.damage_received) : 0,
|
||||||
? globalThis.Number(object.capture_points)
|
dropped_capture_points: isSet(object.dropped_capture_points)
|
||||||
: 0,
|
|
||||||
damage_dealt: isSet(object.damageDealt)
|
|
||||||
? globalThis.Number(object.damageDealt)
|
|
||||||
: isSet(object.damage_dealt)
|
|
||||||
? globalThis.Number(object.damage_dealt)
|
|
||||||
: 0,
|
|
||||||
damage_received: isSet(object.damageReceived)
|
|
||||||
? globalThis.Number(object.damageReceived)
|
|
||||||
: isSet(object.damage_received)
|
|
||||||
? globalThis.Number(object.damage_received)
|
|
||||||
: 0,
|
|
||||||
dropped_capture_points: isSet(object.droppedCapturePoints)
|
|
||||||
? globalThis.Number(object.droppedCapturePoints)
|
|
||||||
: isSet(object.dropped_capture_points)
|
|
||||||
? globalThis.Number(object.dropped_capture_points)
|
? globalThis.Number(object.dropped_capture_points)
|
||||||
: 0,
|
: 0,
|
||||||
frags: isSet(object.frags) ? globalThis.Number(object.frags) : 0,
|
frags: isSet(object.frags) ? globalThis.Number(object.frags) : 0,
|
||||||
frags8p: isSet(object.frags8p) ? globalThis.Number(object.frags8p) : 0,
|
frags8p: isSet(object.frags8p) ? globalThis.Number(object.frags8p) : 0,
|
||||||
hits: isSet(object.hits) ? globalThis.Number(object.hits) : 0,
|
hits: isSet(object.hits) ? globalThis.Number(object.hits) : 0,
|
||||||
losses: isSet(object.losses) ? globalThis.Number(object.losses) : 0,
|
losses: isSet(object.losses) ? globalThis.Number(object.losses) : 0,
|
||||||
max_frags: isSet(object.maxFrags)
|
max_frags: isSet(object.max_frags) ? globalThis.Number(object.max_frags) : 0,
|
||||||
? globalThis.Number(object.maxFrags)
|
max_xp: isSet(object.max_xp) ? globalThis.Number(object.max_xp) : 0,
|
||||||
: isSet(object.max_frags)
|
|
||||||
? globalThis.Number(object.max_frags)
|
|
||||||
: 0,
|
|
||||||
max_xp: isSet(object.maxXp)
|
|
||||||
? globalThis.Number(object.maxXp)
|
|
||||||
: isSet(object.max_xp)
|
|
||||||
? globalThis.Number(object.max_xp)
|
|
||||||
: 0,
|
|
||||||
shots: isSet(object.shots) ? globalThis.Number(object.shots) : 0,
|
shots: isSet(object.shots) ? globalThis.Number(object.shots) : 0,
|
||||||
spotted: isSet(object.spotted) ? globalThis.Number(object.spotted) : 0,
|
spotted: isSet(object.spotted) ? globalThis.Number(object.spotted) : 0,
|
||||||
survived_battles: isSet(object.survivedBattles)
|
survived_battles: isSet(object.survived_battles) ? globalThis.Number(object.survived_battles) : 0,
|
||||||
? globalThis.Number(object.survivedBattles)
|
win_and_survived: isSet(object.win_and_survived) ? globalThis.Number(object.win_and_survived) : 0,
|
||||||
: isSet(object.survived_battles)
|
|
||||||
? globalThis.Number(object.survived_battles)
|
|
||||||
: 0,
|
|
||||||
win_and_survived: isSet(object.winAndSurvived)
|
|
||||||
? globalThis.Number(object.winAndSurvived)
|
|
||||||
: isSet(object.win_and_survived)
|
|
||||||
? globalThis.Number(object.win_and_survived)
|
|
||||||
: 0,
|
|
||||||
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
||||||
xp: isSet(object.xp) ? globalThis.Number(object.xp) : 0,
|
xp: isSet(object.xp) ? globalThis.Number(object.xp) : 0,
|
||||||
battle_life_time: isSet(object.battleLifeTime)
|
battle_life_time: isSet(object.battle_life_time) ? globalThis.Number(object.battle_life_time) : 0,
|
||||||
? globalThis.Number(object.battleLifeTime)
|
|
||||||
: isSet(object.battle_life_time)
|
|
||||||
? globalThis.Number(object.battle_life_time)
|
|
||||||
: 0,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -682,16 +645,16 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.battles = message.battles;
|
obj.battles = message.battles;
|
||||||
}
|
}
|
||||||
if (message.capture_points !== 0) {
|
if (message.capture_points !== 0) {
|
||||||
obj.capturePoints = message.capture_points;
|
obj.capture_points = message.capture_points;
|
||||||
}
|
}
|
||||||
if (message.damage_dealt !== 0) {
|
if (message.damage_dealt !== 0) {
|
||||||
obj.damageDealt = message.damage_dealt;
|
obj.damage_dealt = message.damage_dealt;
|
||||||
}
|
}
|
||||||
if (message.damage_received !== 0) {
|
if (message.damage_received !== 0) {
|
||||||
obj.damageReceived = message.damage_received;
|
obj.damage_received = message.damage_received;
|
||||||
}
|
}
|
||||||
if (message.dropped_capture_points !== 0) {
|
if (message.dropped_capture_points !== 0) {
|
||||||
obj.droppedCapturePoints = message.dropped_capture_points;
|
obj.dropped_capture_points = message.dropped_capture_points;
|
||||||
}
|
}
|
||||||
if (message.frags !== 0) {
|
if (message.frags !== 0) {
|
||||||
obj.frags = message.frags;
|
obj.frags = message.frags;
|
||||||
@@ -706,10 +669,10 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.losses = message.losses;
|
obj.losses = message.losses;
|
||||||
}
|
}
|
||||||
if (message.max_frags !== 0) {
|
if (message.max_frags !== 0) {
|
||||||
obj.maxFrags = message.max_frags;
|
obj.max_frags = message.max_frags;
|
||||||
}
|
}
|
||||||
if (message.max_xp !== 0) {
|
if (message.max_xp !== 0) {
|
||||||
obj.maxXp = message.max_xp;
|
obj.max_xp = message.max_xp;
|
||||||
}
|
}
|
||||||
if (message.shots !== 0) {
|
if (message.shots !== 0) {
|
||||||
obj.shots = message.shots;
|
obj.shots = message.shots;
|
||||||
@@ -718,10 +681,10 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.spotted = message.spotted;
|
obj.spotted = message.spotted;
|
||||||
}
|
}
|
||||||
if (message.survived_battles !== 0) {
|
if (message.survived_battles !== 0) {
|
||||||
obj.survivedBattles = message.survived_battles;
|
obj.survived_battles = message.survived_battles;
|
||||||
}
|
}
|
||||||
if (message.win_and_survived !== 0) {
|
if (message.win_and_survived !== 0) {
|
||||||
obj.winAndSurvived = message.win_and_survived;
|
obj.win_and_survived = message.win_and_survived;
|
||||||
}
|
}
|
||||||
if (message.wins !== 0) {
|
if (message.wins !== 0) {
|
||||||
obj.wins = message.wins;
|
obj.wins = message.wins;
|
||||||
@@ -730,7 +693,7 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.xp = message.xp;
|
obj.xp = message.xp;
|
||||||
}
|
}
|
||||||
if (message.battle_life_time !== 0) {
|
if (message.battle_life_time !== 0) {
|
||||||
obj.battleLifeTime = message.battle_life_time;
|
obj.battle_life_time = message.battle_life_time;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -866,16 +829,12 @@ export const Samples: MessageFns<Samples> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Samples {
|
fromJSON(object: any): Samples {
|
||||||
return {
|
return {
|
||||||
d_1: isSet(object.d1) ? globalThis.Number(object.d1) : isSet(object.d_1) ? globalThis.Number(object.d_1) : 0,
|
d_1: isSet(object.d_1) ? globalThis.Number(object.d_1) : 0,
|
||||||
d_7: isSet(object.d7) ? globalThis.Number(object.d7) : isSet(object.d_7) ? globalThis.Number(object.d_7) : 0,
|
d_7: isSet(object.d_7) ? globalThis.Number(object.d_7) : 0,
|
||||||
d_30: isSet(object.d30) ? globalThis.Number(object.d30) : isSet(object.d_30) ? globalThis.Number(object.d_30) : 0,
|
d_30: isSet(object.d_30) ? globalThis.Number(object.d_30) : 0,
|
||||||
d_60: isSet(object.d60) ? globalThis.Number(object.d60) : isSet(object.d_60) ? globalThis.Number(object.d_60) : 0,
|
d_60: isSet(object.d_60) ? globalThis.Number(object.d_60) : 0,
|
||||||
d_90: isSet(object.d90) ? globalThis.Number(object.d90) : isSet(object.d_90) ? globalThis.Number(object.d_90) : 0,
|
d_90: isSet(object.d_90) ? globalThis.Number(object.d_90) : 0,
|
||||||
d_120: isSet(object.d120)
|
d_120: isSet(object.d_120) ? globalThis.Number(object.d_120) : 0,
|
||||||
? globalThis.Number(object.d120)
|
|
||||||
: isSet(object.d_120)
|
|
||||||
? globalThis.Number(object.d_120)
|
|
||||||
: 0,
|
|
||||||
total: isSet(object.total) ? globalThis.Number(object.total) : 0,
|
total: isSet(object.total) ? globalThis.Number(object.total) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -883,22 +842,22 @@ export const Samples: MessageFns<Samples> = {
|
|||||||
toJSON(message: Samples): unknown {
|
toJSON(message: Samples): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.d_1 !== 0) {
|
if (message.d_1 !== 0) {
|
||||||
obj.d1 = Math.round(message.d_1);
|
obj.d_1 = Math.round(message.d_1);
|
||||||
}
|
}
|
||||||
if (message.d_7 !== 0) {
|
if (message.d_7 !== 0) {
|
||||||
obj.d7 = Math.round(message.d_7);
|
obj.d_7 = Math.round(message.d_7);
|
||||||
}
|
}
|
||||||
if (message.d_30 !== 0) {
|
if (message.d_30 !== 0) {
|
||||||
obj.d30 = Math.round(message.d_30);
|
obj.d_30 = Math.round(message.d_30);
|
||||||
}
|
}
|
||||||
if (message.d_60 !== 0) {
|
if (message.d_60 !== 0) {
|
||||||
obj.d60 = Math.round(message.d_60);
|
obj.d_60 = Math.round(message.d_60);
|
||||||
}
|
}
|
||||||
if (message.d_90 !== 0) {
|
if (message.d_90 !== 0) {
|
||||||
obj.d90 = Math.round(message.d_90);
|
obj.d_90 = Math.round(message.d_90);
|
||||||
}
|
}
|
||||||
if (message.d_120 !== 0) {
|
if (message.d_120 !== 0) {
|
||||||
obj.d120 = Math.round(message.d_120);
|
obj.d_120 = Math.round(message.d_120);
|
||||||
}
|
}
|
||||||
if (message.total !== 0) {
|
if (message.total !== 0) {
|
||||||
obj.total = Math.round(message.total);
|
obj.total = Math.round(message.total);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: camouflage_definitions.proto
|
// source: camouflage_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -32,7 +32,7 @@ function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
|||||||
|
|
||||||
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||||
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.camouflages).forEach(([key, value]: [string, Camouflage]) => {
|
Object.entries(message.camouflages).forEach(([key, value]) => {
|
||||||
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -68,13 +68,10 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
fromJSON(object: any): CamouflageDefinitions {
|
fromJSON(object: any): CamouflageDefinitions {
|
||||||
return {
|
return {
|
||||||
camouflages: isObject(object.camouflages)
|
camouflages: isObject(object.camouflages)
|
||||||
? (globalThis.Object.entries(object.camouflages) as [string, any][]).reduce(
|
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Camouflage }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -82,7 +79,7 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
toJSON(message: CamouflageDefinitions): unknown {
|
toJSON(message: CamouflageDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.camouflages) {
|
if (message.camouflages) {
|
||||||
const entries = globalThis.Object.entries(message.camouflages) as [string, Camouflage][];
|
const entries = Object.entries(message.camouflages);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.camouflages = {};
|
obj.camouflages = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -98,8 +95,8 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
message.camouflages = (globalThis.Object.entries(object.camouflages ?? {}) as [string, Camouflage][]).reduce(
|
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
|
||||||
(acc: { [key: number]: Camouflage }, [key, value]: [string, Camouflage]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -266,16 +263,8 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
return {
|
return {
|
||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
tank_name: isSet(object.tankName)
|
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
|
||||||
? I18nString.fromJSON(object.tankName)
|
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
|
||||||
: isSet(object.tank_name)
|
|
||||||
? I18nString.fromJSON(object.tank_name)
|
|
||||||
: undefined,
|
|
||||||
tank_name_full: isSet(object.tankNameFull)
|
|
||||||
? I18nString.fromJSON(object.tankNameFull)
|
|
||||||
: isSet(object.tank_name_full)
|
|
||||||
? I18nString.fromJSON(object.tank_name_full)
|
|
||||||
: undefined,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -288,10 +277,10 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
obj.name = I18nString.toJSON(message.name);
|
obj.name = I18nString.toJSON(message.name);
|
||||||
}
|
}
|
||||||
if (message.tank_name !== undefined) {
|
if (message.tank_name !== undefined) {
|
||||||
obj.tankName = I18nString.toJSON(message.tank_name);
|
obj.tank_name = I18nString.toJSON(message.tank_name);
|
||||||
}
|
}
|
||||||
if (message.tank_name_full !== undefined) {
|
if (message.tank_name_full !== undefined) {
|
||||||
obj.tankNameFull = I18nString.toJSON(message.tank_name_full);
|
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: consumable_definitions.proto
|
// source: consumable_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -88,7 +88,7 @@ function createBaseConsumableDefinitions(): ConsumableDefinitions {
|
|||||||
|
|
||||||
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
||||||
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.consumables).forEach(([key, value]: [string, Consumable]) => {
|
Object.entries(message.consumables).forEach(([key, value]) => {
|
||||||
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -124,13 +124,10 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
fromJSON(object: any): ConsumableDefinitions {
|
fromJSON(object: any): ConsumableDefinitions {
|
||||||
return {
|
return {
|
||||||
consumables: isObject(object.consumables)
|
consumables: isObject(object.consumables)
|
||||||
? (globalThis.Object.entries(object.consumables) as [string, any][]).reduce(
|
? Object.entries(object.consumables).reduce<{ [key: number]: Consumable }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Consumable }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -138,7 +135,7 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
toJSON(message: ConsumableDefinitions): unknown {
|
toJSON(message: ConsumableDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.consumables) {
|
if (message.consumables) {
|
||||||
const entries = globalThis.Object.entries(message.consumables) as [string, Consumable][];
|
const entries = Object.entries(message.consumables);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.consumables = {};
|
obj.consumables = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -154,8 +151,8 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
||||||
const message = createBaseConsumableDefinitions();
|
const message = createBaseConsumableDefinitions();
|
||||||
message.consumables = (globalThis.Object.entries(object.consumables ?? {}) as [string, Consumable][]).reduce(
|
message.consumables = Object.entries(object.consumables ?? {}).reduce<{ [key: number]: Consumable }>(
|
||||||
(acc: { [key: number]: Consumable }, [key, value]: [string, Consumable]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -357,11 +354,7 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
cooldown: isSet(object.cooldown) ? globalThis.Number(object.cooldown) : 0,
|
cooldown: isSet(object.cooldown) ? globalThis.Number(object.cooldown) : 0,
|
||||||
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
||||||
game_mode_exclusive: isSet(object.gameModeExclusive)
|
game_mode_exclusive: isSet(object.game_mode_exclusive) ? globalThis.Boolean(object.game_mode_exclusive) : false,
|
||||||
? globalThis.Boolean(object.gameModeExclusive)
|
|
||||||
: isSet(object.game_mode_exclusive)
|
|
||||||
? globalThis.Boolean(object.game_mode_exclusive)
|
|
||||||
: false,
|
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -386,7 +379,7 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
obj.duration = message.duration;
|
obj.duration = message.duration;
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
obj.gameModeExclusive = message.game_mode_exclusive;
|
obj.game_mode_exclusive = message.game_mode_exclusive;
|
||||||
}
|
}
|
||||||
if (message.include?.length) {
|
if (message.include?.length) {
|
||||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: equipment_definitions.proto
|
// source: equipment_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -45,10 +45,10 @@ function createBaseEquipmentDefinitions(): EquipmentDefinitions {
|
|||||||
|
|
||||||
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||||
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.presets).forEach(([key, value]: [string, EquipmentPreset]) => {
|
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();
|
||||||
});
|
});
|
||||||
globalThis.Object.entries(message.equipments).forEach(([key, value]: [string, Equipment]) => {
|
Object.entries(message.equipments).forEach(([key, value]) => {
|
||||||
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -95,22 +95,16 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
fromJSON(object: any): EquipmentDefinitions {
|
fromJSON(object: any): EquipmentDefinitions {
|
||||||
return {
|
return {
|
||||||
presets: isObject(object.presets)
|
presets: isObject(object.presets)
|
||||||
? (globalThis.Object.entries(object.presets) as [string, any][]).reduce(
|
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
|
||||||
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, any]) => {
|
acc[key] = EquipmentPreset.fromJSON(value);
|
||||||
acc[key] = EquipmentPreset.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
equipments: isObject(object.equipments)
|
equipments: isObject(object.equipments)
|
||||||
? (globalThis.Object.entries(object.equipments) as [string, any][]).reduce(
|
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Equipment }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -118,7 +112,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
toJSON(message: EquipmentDefinitions): unknown {
|
toJSON(message: EquipmentDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.presets) {
|
if (message.presets) {
|
||||||
const entries = globalThis.Object.entries(message.presets) as [string, EquipmentPreset][];
|
const entries = Object.entries(message.presets);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.presets = {};
|
obj.presets = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -127,7 +121,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.equipments) {
|
if (message.equipments) {
|
||||||
const entries = globalThis.Object.entries(message.equipments) as [string, Equipment][];
|
const entries = Object.entries(message.equipments);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.equipments = {};
|
obj.equipments = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -143,8 +137,8 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
||||||
const message = createBaseEquipmentDefinitions();
|
const message = createBaseEquipmentDefinitions();
|
||||||
message.presets = (globalThis.Object.entries(object.presets ?? {}) as [string, EquipmentPreset][]).reduce(
|
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
|
||||||
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, EquipmentPreset]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[key] = EquipmentPreset.fromPartial(value);
|
acc[key] = EquipmentPreset.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -152,8 +146,8 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
message.equipments = (globalThis.Object.entries(object.equipments ?? {}) as [string, Equipment][]).reduce(
|
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
|
||||||
(acc: { [key: number]: Equipment }, [key, value]: [string, Equipment]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: gallery.proto
|
// source: gallery.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import "i18n.proto";
|
|||||||
message GameDefinitions {
|
message GameDefinitions {
|
||||||
required string version = 1;
|
required string version = 1;
|
||||||
repeated string nations = 2;
|
repeated string nations = 2;
|
||||||
map<uint32, GameMode> gameModes = 3;
|
map<string, GameMode> gameModes = 3;
|
||||||
map<uint32, GameModeRole> roles = 4;
|
map<uint32, GameModeRole> roles = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: game_definitions.proto
|
// source: game_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -13,12 +13,12 @@ export const protobufPackage = "blitzkit";
|
|||||||
export interface GameDefinitions {
|
export interface GameDefinitions {
|
||||||
version: string;
|
version: string;
|
||||||
nations: string[];
|
nations: string[];
|
||||||
gameModes: { [key: number]: GameMode };
|
gameModes: { [key: string]: GameMode };
|
||||||
roles: { [key: number]: GameModeRole };
|
roles: { [key: number]: GameModeRole };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GameDefinitions_GameModesEntry {
|
export interface GameDefinitions_GameModesEntry {
|
||||||
key: number;
|
key: string;
|
||||||
value: GameMode | undefined;
|
value: GameMode | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,10 +48,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
for (const v of message.nations) {
|
for (const v of message.nations) {
|
||||||
writer.uint32(18).string(v!);
|
writer.uint32(18).string(v!);
|
||||||
}
|
}
|
||||||
globalThis.Object.entries(message.gameModes).forEach(([key, value]: [string, GameMode]) => {
|
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();
|
||||||
});
|
});
|
||||||
globalThis.Object.entries(message.roles).forEach(([key, value]: [string, GameModeRole]) => {
|
Object.entries(message.roles).forEach(([key, value]) => {
|
||||||
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -116,22 +116,16 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
version: isSet(object.version) ? globalThis.String(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)
|
||||||
? (globalThis.Object.entries(object.gameModes) as [string, any][]).reduce(
|
? Object.entries(object.gameModes).reduce<{ [key: string]: GameMode }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: GameMode }, [key, value]: [string, any]) => {
|
acc[key] = GameMode.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
roles: isObject(object.roles)
|
roles: isObject(object.roles)
|
||||||
? (globalThis.Object.entries(object.roles) as [string, any][]).reduce(
|
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: GameModeRole }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -145,7 +139,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
obj.nations = message.nations;
|
obj.nations = message.nations;
|
||||||
}
|
}
|
||||||
if (message.gameModes) {
|
if (message.gameModes) {
|
||||||
const entries = globalThis.Object.entries(message.gameModes) as [string, GameMode][];
|
const entries = Object.entries(message.gameModes);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.gameModes = {};
|
obj.gameModes = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -154,7 +148,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.roles) {
|
if (message.roles) {
|
||||||
const entries = globalThis.Object.entries(message.roles) as [string, GameModeRole][];
|
const entries = Object.entries(message.roles);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.roles = {};
|
obj.roles = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -172,36 +166,33 @@ export const GameDefinitions: MessageFns<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 = (globalThis.Object.entries(object.gameModes ?? {}) as [string, GameMode][]).reduce(
|
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: string]: GameMode }>(
|
||||||
(acc: { [key: number]: GameMode }, [key, value]: [string, GameMode]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
acc[key] = GameMode.fromPartial(value);
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
message.roles = (globalThis.Object.entries(object.roles ?? {}) as [string, GameModeRole][]).reduce(
|
|
||||||
(acc: { [key: number]: GameModeRole }, [key, value]: [string, GameModeRole]) => {
|
|
||||||
if (value !== undefined) {
|
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
|
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
||||||
|
if (value !== undefined) {
|
||||||
|
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEntry {
|
function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEntry {
|
||||||
return { key: 0, value: undefined };
|
return { key: "", value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
||||||
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== 0) {
|
if (message.key !== "") {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(10).string(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
GameMode.encode(message.value, writer.uint32(18).fork()).join();
|
GameMode.encode(message.value, writer.uint32(18).fork()).join();
|
||||||
@@ -217,11 +208,11 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
switch (tag >>> 3) {
|
switch (tag >>> 3) {
|
||||||
case 1: {
|
case 1: {
|
||||||
if (tag !== 8) {
|
if (tag !== 10) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.key = reader.uint32();
|
message.key = reader.string();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
@@ -243,15 +234,15 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||||
return {
|
return {
|
||||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||||
value: isSet(object.value) ? GameMode.fromJSON(object.value) : undefined,
|
value: isSet(object.value) ? GameMode.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== 0) {
|
if (message.key !== "") {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = message.key;
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
obj.value = GameMode.toJSON(message.value);
|
obj.value = GameMode.toJSON(message.value);
|
||||||
@@ -266,7 +257,7 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
object: I,
|
object: I,
|
||||||
): GameDefinitions_GameModesEntry {
|
): GameDefinitions_GameModesEntry {
|
||||||
const message = createBaseGameDefinitions_GameModesEntry();
|
const message = createBaseGameDefinitions_GameModesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? "";
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? GameMode.fromPartial(object.value)
|
? GameMode.fromPartial(object.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: i18n.proto
|
// source: i18n.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -24,7 +24,7 @@ function createBaseI18nString(): I18nString {
|
|||||||
|
|
||||||
export const I18nString: MessageFns<I18nString> = {
|
export const I18nString: MessageFns<I18nString> = {
|
||||||
encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.locales).forEach(([key, value]: [string, string]) => {
|
Object.entries(message.locales).forEach(([key, value]) => {
|
||||||
I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -60,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)
|
||||||
? (globalThis.Object.entries(object.locales) as [string, any][]).reduce(
|
? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
|
||||||
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
acc[key] = String(value);
|
||||||
acc[key] = globalThis.String(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -74,7 +71,7 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
toJSON(message: I18nString): unknown {
|
toJSON(message: I18nString): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.locales) {
|
if (message.locales) {
|
||||||
const entries = globalThis.Object.entries(message.locales) as [string, string][];
|
const entries = Object.entries(message.locales);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.locales = {};
|
obj.locales = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -90,15 +87,12 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
|
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
|
||||||
const message = createBaseI18nString();
|
const message = createBaseI18nString();
|
||||||
message.locales = (globalThis.Object.entries(object.locales ?? {}) as [string, string][]).reduce(
|
message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
|
||||||
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[key] = globalThis.String(value);
|
||||||
acc[key] = globalThis.String(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
}, {});
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: map_definitions.proto
|
// source: map_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -30,7 +30,7 @@ function createBaseMapDefinitions(): MapDefinitions {
|
|||||||
|
|
||||||
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||||
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.maps).forEach(([key, value]: [string, MapDefinition]) => {
|
Object.entries(message.maps).forEach(([key, value]) => {
|
||||||
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -66,13 +66,10 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
fromJSON(object: any): MapDefinitions {
|
fromJSON(object: any): MapDefinitions {
|
||||||
return {
|
return {
|
||||||
maps: isObject(object.maps)
|
maps: isObject(object.maps)
|
||||||
? (globalThis.Object.entries(object.maps) as [string, any][]).reduce(
|
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: MapDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -80,7 +77,7 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
toJSON(message: MapDefinitions): unknown {
|
toJSON(message: MapDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.maps) {
|
if (message.maps) {
|
||||||
const entries = globalThis.Object.entries(message.maps) as [string, MapDefinition][];
|
const entries = Object.entries(message.maps);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.maps = {};
|
obj.maps = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -96,15 +93,12 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
||||||
const message = createBaseMapDefinitions();
|
const message = createBaseMapDefinitions();
|
||||||
message.maps = (globalThis.Object.entries(object.maps ?? {}) as [string, MapDefinition][]).reduce(
|
message.maps = Object.entries(object.maps ?? {}).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: MapDefinition }, [key, value]: [string, MapDefinition]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
}, {});
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: model_definitions.proto
|
// source: model_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -116,7 +116,7 @@ function createBaseModelDefinitions(): ModelDefinitions {
|
|||||||
|
|
||||||
export const ModelDefinitions: MessageFns<ModelDefinitions> = {
|
export const ModelDefinitions: MessageFns<ModelDefinitions> = {
|
||||||
encode(message: ModelDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ModelDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.models).forEach(([key, value]: [string, ModelDefinition]) => {
|
Object.entries(message.models).forEach(([key, value]) => {
|
||||||
ModelDefinitions_ModelsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ModelDefinitions_ModelsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -152,13 +152,10 @@ export const ModelDefinitions: MessageFns<ModelDefinitions> = {
|
|||||||
fromJSON(object: any): ModelDefinitions {
|
fromJSON(object: any): ModelDefinitions {
|
||||||
return {
|
return {
|
||||||
models: isObject(object.models)
|
models: isObject(object.models)
|
||||||
? (globalThis.Object.entries(object.models) as [string, any][]).reduce(
|
? Object.entries(object.models).reduce<{ [key: number]: ModelDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: ModelDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = ModelDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = ModelDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -166,7 +163,7 @@ export const ModelDefinitions: MessageFns<ModelDefinitions> = {
|
|||||||
toJSON(message: ModelDefinitions): unknown {
|
toJSON(message: ModelDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.models) {
|
if (message.models) {
|
||||||
const entries = globalThis.Object.entries(message.models) as [string, ModelDefinition][];
|
const entries = Object.entries(message.models);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.models = {};
|
obj.models = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -182,8 +179,8 @@ export const ModelDefinitions: MessageFns<ModelDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ModelDefinitions>, I>>(object: I): ModelDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ModelDefinitions>, I>>(object: I): ModelDefinitions {
|
||||||
const message = createBaseModelDefinitions();
|
const message = createBaseModelDefinitions();
|
||||||
message.models = (globalThis.Object.entries(object.models ?? {}) as [string, ModelDefinition][]).reduce(
|
message.models = Object.entries(object.models ?? {}).reduce<{ [key: number]: ModelDefinition }>(
|
||||||
(acc: { [key: number]: ModelDefinition }, [key, value]: [string, ModelDefinition]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = ModelDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = ModelDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -295,10 +292,10 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
if (message.initial_turret_rotation !== undefined) {
|
if (message.initial_turret_rotation !== undefined) {
|
||||||
InitialTurretRotation.encode(message.initial_turret_rotation, writer.uint32(26).fork()).join();
|
InitialTurretRotation.encode(message.initial_turret_rotation, writer.uint32(26).fork()).join();
|
||||||
}
|
}
|
||||||
globalThis.Object.entries(message.turrets).forEach(([key, value]: [string, TurretModelDefinition]) => {
|
Object.entries(message.turrets).forEach(([key, value]) => {
|
||||||
ModelDefinition_TurretsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
ModelDefinition_TurretsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
||||||
});
|
});
|
||||||
globalThis.Object.entries(message.tracks).forEach(([key, value]: [string, TrackModelDefinition]) => {
|
Object.entries(message.tracks).forEach(([key, value]) => {
|
||||||
ModelDefinition_TracksEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
ModelDefinition_TracksEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
||||||
});
|
});
|
||||||
if (message.bounding_box !== undefined) {
|
if (message.bounding_box !== undefined) {
|
||||||
@@ -380,39 +377,23 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
fromJSON(object: any): ModelDefinition {
|
fromJSON(object: any): ModelDefinition {
|
||||||
return {
|
return {
|
||||||
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
||||||
turret_origin: isSet(object.turretOrigin)
|
turret_origin: isSet(object.turret_origin) ? Vector3.fromJSON(object.turret_origin) : undefined,
|
||||||
? Vector3.fromJSON(object.turretOrigin)
|
initial_turret_rotation: isSet(object.initial_turret_rotation)
|
||||||
: isSet(object.turret_origin)
|
|
||||||
? Vector3.fromJSON(object.turret_origin)
|
|
||||||
: undefined,
|
|
||||||
initial_turret_rotation: isSet(object.initialTurretRotation)
|
|
||||||
? InitialTurretRotation.fromJSON(object.initialTurretRotation)
|
|
||||||
: isSet(object.initial_turret_rotation)
|
|
||||||
? InitialTurretRotation.fromJSON(object.initial_turret_rotation)
|
? InitialTurretRotation.fromJSON(object.initial_turret_rotation)
|
||||||
: undefined,
|
: undefined,
|
||||||
turrets: isObject(object.turrets)
|
turrets: isObject(object.turrets)
|
||||||
? (globalThis.Object.entries(object.turrets) as [string, any][]).reduce(
|
? Object.entries(object.turrets).reduce<{ [key: number]: TurretModelDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: TurretModelDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = TurretModelDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = TurretModelDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
tracks: isObject(object.tracks)
|
tracks: isObject(object.tracks)
|
||||||
? (globalThis.Object.entries(object.tracks) as [string, any][]).reduce(
|
? Object.entries(object.tracks).reduce<{ [key: number]: TrackModelDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: TrackModelDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = TrackModelDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = TrackModelDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
bounding_box: isSet(object.boundingBox)
|
bounding_box: isSet(object.bounding_box) ? BoundingBox.fromJSON(object.bounding_box) : undefined,
|
||||||
? BoundingBox.fromJSON(object.boundingBox)
|
|
||||||
: isSet(object.bounding_box)
|
|
||||||
? BoundingBox.fromJSON(object.bounding_box)
|
|
||||||
: undefined,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -422,13 +403,13 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
obj.armor = Armor.toJSON(message.armor);
|
obj.armor = Armor.toJSON(message.armor);
|
||||||
}
|
}
|
||||||
if (message.turret_origin !== undefined) {
|
if (message.turret_origin !== undefined) {
|
||||||
obj.turretOrigin = Vector3.toJSON(message.turret_origin);
|
obj.turret_origin = Vector3.toJSON(message.turret_origin);
|
||||||
}
|
}
|
||||||
if (message.initial_turret_rotation !== undefined) {
|
if (message.initial_turret_rotation !== undefined) {
|
||||||
obj.initialTurretRotation = InitialTurretRotation.toJSON(message.initial_turret_rotation);
|
obj.initial_turret_rotation = InitialTurretRotation.toJSON(message.initial_turret_rotation);
|
||||||
}
|
}
|
||||||
if (message.turrets) {
|
if (message.turrets) {
|
||||||
const entries = globalThis.Object.entries(message.turrets) as [string, TurretModelDefinition][];
|
const entries = Object.entries(message.turrets);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.turrets = {};
|
obj.turrets = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -437,7 +418,7 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.tracks) {
|
if (message.tracks) {
|
||||||
const entries = globalThis.Object.entries(message.tracks) as [string, TrackModelDefinition][];
|
const entries = Object.entries(message.tracks);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.tracks = {};
|
obj.tracks = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -446,7 +427,7 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.bounding_box !== undefined) {
|
if (message.bounding_box !== undefined) {
|
||||||
obj.boundingBox = BoundingBox.toJSON(message.bounding_box);
|
obj.bounding_box = BoundingBox.toJSON(message.bounding_box);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -464,8 +445,8 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
(object.initial_turret_rotation !== undefined && object.initial_turret_rotation !== null)
|
(object.initial_turret_rotation !== undefined && object.initial_turret_rotation !== null)
|
||||||
? InitialTurretRotation.fromPartial(object.initial_turret_rotation)
|
? InitialTurretRotation.fromPartial(object.initial_turret_rotation)
|
||||||
: undefined;
|
: undefined;
|
||||||
message.turrets = (globalThis.Object.entries(object.turrets ?? {}) as [string, TurretModelDefinition][]).reduce(
|
message.turrets = Object.entries(object.turrets ?? {}).reduce<{ [key: number]: TurretModelDefinition }>(
|
||||||
(acc: { [key: number]: TurretModelDefinition }, [key, value]: [string, TurretModelDefinition]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = TurretModelDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = TurretModelDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -473,8 +454,8 @@ export const ModelDefinition: MessageFns<ModelDefinition> = {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
message.tracks = (globalThis.Object.entries(object.tracks ?? {}) as [string, TrackModelDefinition][]).reduce(
|
message.tracks = Object.entries(object.tracks ?? {}).reduce<{ [key: number]: TrackModelDefinition }>(
|
||||||
(acc: { [key: number]: TrackModelDefinition }, [key, value]: [string, TrackModelDefinition]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = TrackModelDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = TrackModelDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -651,7 +632,7 @@ function createBaseArmor(): Armor {
|
|||||||
|
|
||||||
export const Armor: MessageFns<Armor> = {
|
export const Armor: MessageFns<Armor> = {
|
||||||
encode(message: Armor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Armor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.thickness).forEach(([key, value]: [string, number]) => {
|
Object.entries(message.thickness).forEach(([key, value]) => {
|
||||||
Armor_ThicknessEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
Armor_ThicknessEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
for (const v of message.spaced) {
|
for (const v of message.spaced) {
|
||||||
@@ -708,13 +689,10 @@ export const Armor: MessageFns<Armor> = {
|
|||||||
fromJSON(object: any): Armor {
|
fromJSON(object: any): Armor {
|
||||||
return {
|
return {
|
||||||
thickness: isObject(object.thickness)
|
thickness: isObject(object.thickness)
|
||||||
? (globalThis.Object.entries(object.thickness) as [string, any][]).reduce(
|
? Object.entries(object.thickness).reduce<{ [key: number]: number }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: number }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Number(value);
|
||||||
acc[globalThis.Number(key)] = globalThis.Number(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
spaced: globalThis.Array.isArray(object?.spaced) ? object.spaced.map((e: any) => globalThis.Number(e)) : [],
|
spaced: globalThis.Array.isArray(object?.spaced) ? object.spaced.map((e: any) => globalThis.Number(e)) : [],
|
||||||
};
|
};
|
||||||
@@ -723,7 +701,7 @@ export const Armor: MessageFns<Armor> = {
|
|||||||
toJSON(message: Armor): unknown {
|
toJSON(message: Armor): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.thickness) {
|
if (message.thickness) {
|
||||||
const entries = globalThis.Object.entries(message.thickness) as [string, number][];
|
const entries = Object.entries(message.thickness);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.thickness = {};
|
obj.thickness = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -742,8 +720,8 @@ export const Armor: MessageFns<Armor> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Armor>, I>>(object: I): Armor {
|
fromPartial<I extends Exact<DeepPartial<Armor>, I>>(object: I): Armor {
|
||||||
const message = createBaseArmor();
|
const message = createBaseArmor();
|
||||||
message.thickness = (globalThis.Object.entries(object.thickness ?? {}) as [string, number][]).reduce(
|
message.thickness = Object.entries(object.thickness ?? {}).reduce<{ [key: number]: number }>(
|
||||||
(acc: { [key: number]: number }, [key, value]: [string, number]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = globalThis.Number(value);
|
acc[globalThis.Number(key)] = globalThis.Number(value);
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1012,7 @@ export const TurretModelDefinition: MessageFns<TurretModelDefinition> = {
|
|||||||
if (message.gun_origin !== undefined) {
|
if (message.gun_origin !== undefined) {
|
||||||
Vector3.encode(message.gun_origin, writer.uint32(34).fork()).join();
|
Vector3.encode(message.gun_origin, writer.uint32(34).fork()).join();
|
||||||
}
|
}
|
||||||
globalThis.Object.entries(message.guns).forEach(([key, value]: [string, GunModelDefinition]) => {
|
Object.entries(message.guns).forEach(([key, value]) => {
|
||||||
TurretModelDefinition_GunsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
TurretModelDefinition_GunsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
||||||
});
|
});
|
||||||
if (message.yaw !== undefined) {
|
if (message.yaw !== undefined) {
|
||||||
@@ -1112,30 +1090,15 @@ export const TurretModelDefinition: MessageFns<TurretModelDefinition> = {
|
|||||||
|
|
||||||
fromJSON(object: any): TurretModelDefinition {
|
fromJSON(object: any): TurretModelDefinition {
|
||||||
return {
|
return {
|
||||||
bounding_box: isSet(object.boundingBox)
|
bounding_box: isSet(object.bounding_box) ? BoundingBox.fromJSON(object.bounding_box) : undefined,
|
||||||
? BoundingBox.fromJSON(object.boundingBox)
|
|
||||||
: isSet(object.bounding_box)
|
|
||||||
? BoundingBox.fromJSON(object.bounding_box)
|
|
||||||
: undefined,
|
|
||||||
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
||||||
model_id: isSet(object.modelId)
|
model_id: isSet(object.model_id) ? globalThis.Number(object.model_id) : 0,
|
||||||
? globalThis.Number(object.modelId)
|
gun_origin: isSet(object.gun_origin) ? Vector3.fromJSON(object.gun_origin) : undefined,
|
||||||
: isSet(object.model_id)
|
|
||||||
? globalThis.Number(object.model_id)
|
|
||||||
: 0,
|
|
||||||
gun_origin: isSet(object.gunOrigin)
|
|
||||||
? Vector3.fromJSON(object.gunOrigin)
|
|
||||||
: isSet(object.gun_origin)
|
|
||||||
? Vector3.fromJSON(object.gun_origin)
|
|
||||||
: undefined,
|
|
||||||
guns: isObject(object.guns)
|
guns: isObject(object.guns)
|
||||||
? (globalThis.Object.entries(object.guns) as [string, any][]).reduce(
|
? Object.entries(object.guns).reduce<{ [key: number]: GunModelDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: GunModelDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = GunModelDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = GunModelDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
yaw: isSet(object.yaw) ? YawLimits.fromJSON(object.yaw) : undefined,
|
yaw: isSet(object.yaw) ? YawLimits.fromJSON(object.yaw) : undefined,
|
||||||
};
|
};
|
||||||
@@ -1144,19 +1107,19 @@ export const TurretModelDefinition: MessageFns<TurretModelDefinition> = {
|
|||||||
toJSON(message: TurretModelDefinition): unknown {
|
toJSON(message: TurretModelDefinition): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.bounding_box !== undefined) {
|
if (message.bounding_box !== undefined) {
|
||||||
obj.boundingBox = BoundingBox.toJSON(message.bounding_box);
|
obj.bounding_box = BoundingBox.toJSON(message.bounding_box);
|
||||||
}
|
}
|
||||||
if (message.armor !== undefined) {
|
if (message.armor !== undefined) {
|
||||||
obj.armor = Armor.toJSON(message.armor);
|
obj.armor = Armor.toJSON(message.armor);
|
||||||
}
|
}
|
||||||
if (message.model_id !== 0) {
|
if (message.model_id !== 0) {
|
||||||
obj.modelId = Math.round(message.model_id);
|
obj.model_id = Math.round(message.model_id);
|
||||||
}
|
}
|
||||||
if (message.gun_origin !== undefined) {
|
if (message.gun_origin !== undefined) {
|
||||||
obj.gunOrigin = Vector3.toJSON(message.gun_origin);
|
obj.gun_origin = Vector3.toJSON(message.gun_origin);
|
||||||
}
|
}
|
||||||
if (message.guns) {
|
if (message.guns) {
|
||||||
const entries = globalThis.Object.entries(message.guns) as [string, GunModelDefinition][];
|
const entries = Object.entries(message.guns);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.guns = {};
|
obj.guns = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -1183,8 +1146,8 @@ export const TurretModelDefinition: MessageFns<TurretModelDefinition> = {
|
|||||||
message.gun_origin = (object.gun_origin !== undefined && object.gun_origin !== null)
|
message.gun_origin = (object.gun_origin !== undefined && object.gun_origin !== null)
|
||||||
? Vector3.fromPartial(object.gun_origin)
|
? Vector3.fromPartial(object.gun_origin)
|
||||||
: undefined;
|
: undefined;
|
||||||
message.guns = (globalThis.Object.entries(object.guns ?? {}) as [string, GunModelDefinition][]).reduce(
|
message.guns = Object.entries(object.guns ?? {}).reduce<{ [key: number]: GunModelDefinition }>(
|
||||||
(acc: { [key: number]: GunModelDefinition }, [key, value]: [string, GunModelDefinition]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GunModelDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = GunModelDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -1591,11 +1554,7 @@ export const GunModelDefinition: MessageFns<GunModelDefinition> = {
|
|||||||
return {
|
return {
|
||||||
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
armor: isSet(object.armor) ? Armor.fromJSON(object.armor) : undefined,
|
||||||
thickness: isSet(object.thickness) ? globalThis.Number(object.thickness) : 0,
|
thickness: isSet(object.thickness) ? globalThis.Number(object.thickness) : 0,
|
||||||
model_id: isSet(object.modelId)
|
model_id: isSet(object.model_id) ? globalThis.Number(object.model_id) : 0,
|
||||||
? globalThis.Number(object.modelId)
|
|
||||||
: isSet(object.model_id)
|
|
||||||
? globalThis.Number(object.model_id)
|
|
||||||
: 0,
|
|
||||||
pitch: isSet(object.pitch) ? PitchLimits.fromJSON(object.pitch) : undefined,
|
pitch: isSet(object.pitch) ? PitchLimits.fromJSON(object.pitch) : undefined,
|
||||||
mask: isSet(object.mask) ? globalThis.Number(object.mask) : 0,
|
mask: isSet(object.mask) ? globalThis.Number(object.mask) : 0,
|
||||||
};
|
};
|
||||||
@@ -1610,7 +1569,7 @@ export const GunModelDefinition: MessageFns<GunModelDefinition> = {
|
|||||||
obj.thickness = message.thickness;
|
obj.thickness = message.thickness;
|
||||||
}
|
}
|
||||||
if (message.model_id !== 0) {
|
if (message.model_id !== 0) {
|
||||||
obj.modelId = Math.round(message.model_id);
|
obj.model_id = Math.round(message.model_id);
|
||||||
}
|
}
|
||||||
if (message.pitch !== undefined) {
|
if (message.pitch !== undefined) {
|
||||||
obj.pitch = PitchLimits.toJSON(message.pitch);
|
obj.pitch = PitchLimits.toJSON(message.pitch);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: popular_tanks.proto
|
// source: popular_tanks.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: provision_definitions.proto
|
// source: provision_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -35,7 +35,7 @@ function createBaseProvisionDefinitions(): ProvisionDefinitions {
|
|||||||
|
|
||||||
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||||
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.provisions).forEach(([key, value]: [string, Provision]) => {
|
Object.entries(message.provisions).forEach(([key, value]) => {
|
||||||
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -71,13 +71,10 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
fromJSON(object: any): ProvisionDefinitions {
|
fromJSON(object: any): ProvisionDefinitions {
|
||||||
return {
|
return {
|
||||||
provisions: isObject(object.provisions)
|
provisions: isObject(object.provisions)
|
||||||
? (globalThis.Object.entries(object.provisions) as [string, any][]).reduce(
|
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Provision }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -85,7 +82,7 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
toJSON(message: ProvisionDefinitions): unknown {
|
toJSON(message: ProvisionDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.provisions) {
|
if (message.provisions) {
|
||||||
const entries = globalThis.Object.entries(message.provisions) as [string, Provision][];
|
const entries = Object.entries(message.provisions);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.provisions = {};
|
obj.provisions = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -101,8 +98,8 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
||||||
const message = createBaseProvisionDefinitions();
|
const message = createBaseProvisionDefinitions();
|
||||||
message.provisions = (globalThis.Object.entries(object.provisions ?? {}) as [string, Provision][]).reduce(
|
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
|
||||||
(acc: { [key: number]: Provision }, [key, value]: [string, Provision]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -292,11 +289,7 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
crew: isSet(object.crew) ? globalThis.Number(object.crew) : 0,
|
crew: isSet(object.crew) ? globalThis.Number(object.crew) : 0,
|
||||||
game_mode_exclusive: isSet(object.gameModeExclusive)
|
game_mode_exclusive: isSet(object.game_mode_exclusive) ? globalThis.Boolean(object.game_mode_exclusive) : false,
|
||||||
? globalThis.Boolean(object.gameModeExclusive)
|
|
||||||
: isSet(object.game_mode_exclusive)
|
|
||||||
? globalThis.Boolean(object.game_mode_exclusive)
|
|
||||||
: false,
|
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -318,7 +311,7 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
obj.crew = message.crew;
|
obj.crew = message.crew;
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
obj.gameModeExclusive = message.game_mode_exclusive;
|
obj.game_mode_exclusive = message.game_mode_exclusive;
|
||||||
}
|
}
|
||||||
if (message.include?.length) {
|
if (message.include?.length) {
|
||||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: rating_leaderboard.proto
|
// source: rating_leaderboard.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: reviews.proto
|
// source: reviews.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -34,7 +34,7 @@ function createBaseReviews(): Reviews {
|
|||||||
|
|
||||||
export const Reviews: MessageFns<Reviews> = {
|
export const Reviews: MessageFns<Reviews> = {
|
||||||
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.reviews).forEach(([key, value]: [string, Review]) => {
|
Object.entries(message.reviews).forEach(([key, value]) => {
|
||||||
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -70,13 +70,10 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
fromJSON(object: any): Reviews {
|
fromJSON(object: any): Reviews {
|
||||||
return {
|
return {
|
||||||
reviews: isObject(object.reviews)
|
reviews: isObject(object.reviews)
|
||||||
? (globalThis.Object.entries(object.reviews) as [string, any][]).reduce(
|
? Object.entries(object.reviews).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Review }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -84,7 +81,7 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
toJSON(message: Reviews): unknown {
|
toJSON(message: Reviews): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.reviews) {
|
if (message.reviews) {
|
||||||
const entries = globalThis.Object.entries(message.reviews) as [string, Review][];
|
const entries = Object.entries(message.reviews);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.reviews = {};
|
obj.reviews = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -100,15 +97,12 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
||||||
const message = createBaseReviews();
|
const message = createBaseReviews();
|
||||||
message.reviews = (globalThis.Object.entries(object.reviews ?? {}) as [string, Review][]).reduce(
|
message.reviews = Object.entries(object.reviews ?? {}).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Review }, [key, value]: [string, Review]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
||||||
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
}, {});
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -240,11 +234,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Review {
|
fromJSON(object: any): Review {
|
||||||
return {
|
return {
|
||||||
last_updated: isSet(object.lastUpdated)
|
last_updated: isSet(object.last_updated) ? globalThis.Number(object.last_updated) : 0,
|
||||||
? globalThis.Number(object.lastUpdated)
|
|
||||||
: isSet(object.last_updated)
|
|
||||||
? globalThis.Number(object.last_updated)
|
|
||||||
: 0,
|
|
||||||
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -252,7 +242,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
toJSON(message: Review): unknown {
|
toJSON(message: Review): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.last_updated !== 0) {
|
if (message.last_updated !== 0) {
|
||||||
obj.lastUpdated = message.last_updated;
|
obj.last_updated = message.last_updated;
|
||||||
}
|
}
|
||||||
if (message.videos?.length) {
|
if (message.videos?.length) {
|
||||||
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: skill_definitions.proto
|
// source: skill_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -29,7 +29,7 @@ function createBaseSkillDefinitions(): SkillDefinitions {
|
|||||||
|
|
||||||
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
||||||
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.classes).forEach(([key, value]: [string, Skill]) => {
|
Object.entries(message.classes).forEach(([key, value]) => {
|
||||||
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -65,13 +65,10 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
fromJSON(object: any): SkillDefinitions {
|
fromJSON(object: any): SkillDefinitions {
|
||||||
return {
|
return {
|
||||||
classes: isObject(object.classes)
|
classes: isObject(object.classes)
|
||||||
? (globalThis.Object.entries(object.classes) as [string, any][]).reduce(
|
? Object.entries(object.classes).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Skill }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -79,7 +76,7 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
toJSON(message: SkillDefinitions): unknown {
|
toJSON(message: SkillDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.classes) {
|
if (message.classes) {
|
||||||
const entries = globalThis.Object.entries(message.classes) as [string, Skill][];
|
const entries = Object.entries(message.classes);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.classes = {};
|
obj.classes = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -95,15 +92,12 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
||||||
const message = createBaseSkillDefinitions();
|
const message = createBaseSkillDefinitions();
|
||||||
message.classes = (globalThis.Object.entries(object.classes ?? {}) as [string, Skill][]).reduce(
|
message.classes = Object.entries(object.classes ?? {}).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: Skill }, [key, value]: [string, Skill]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
||||||
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
}, {});
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ message TankDefinitions {
|
|||||||
message TankDefinition {
|
message TankDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required string slug = 2;
|
required string slug = 2;
|
||||||
map<uint32, uint32> roles = 3;
|
map<string, uint32> roles = 3;
|
||||||
required bool fixed_camouflage = 5;
|
required bool fixed_camouflage = 5;
|
||||||
repeated int32 camouflages = 6;
|
repeated int32 camouflages = 6;
|
||||||
repeated int32 ancestors = 7;
|
repeated int32 ancestors = 7;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.11.2
|
// protoc-gen-ts_proto v2.7.7
|
||||||
// protoc v5.28.2
|
// protoc v3.19.6
|
||||||
// source: tank_definitions.proto
|
// source: tank_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
@@ -262,7 +262,7 @@ export interface TankDefinitions_TanksEntry {
|
|||||||
export interface TankDefinition {
|
export interface TankDefinition {
|
||||||
id: number;
|
id: number;
|
||||||
slug: string;
|
slug: string;
|
||||||
roles: { [key: number]: number };
|
roles: { [key: string]: number };
|
||||||
fixed_camouflage: boolean;
|
fixed_camouflage: boolean;
|
||||||
camouflages: number[];
|
camouflages: number[];
|
||||||
ancestors: number[];
|
ancestors: number[];
|
||||||
@@ -295,7 +295,7 @@ export interface TankDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TankDefinition_RolesEntry {
|
export interface TankDefinition_RolesEntry {
|
||||||
key: number;
|
key: string;
|
||||||
value: number;
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,7 +463,7 @@ function createBaseTankDefinitions(): TankDefinitions {
|
|||||||
|
|
||||||
export const TankDefinitions: MessageFns<TankDefinitions> = {
|
export const TankDefinitions: MessageFns<TankDefinitions> = {
|
||||||
encode(message: TankDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: TankDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
globalThis.Object.entries(message.tanks).forEach(([key, value]: [string, TankDefinition]) => {
|
Object.entries(message.tanks).forEach(([key, value]) => {
|
||||||
TankDefinitions_TanksEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
TankDefinitions_TanksEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -499,13 +499,10 @@ export const TankDefinitions: MessageFns<TankDefinitions> = {
|
|||||||
fromJSON(object: any): TankDefinitions {
|
fromJSON(object: any): TankDefinitions {
|
||||||
return {
|
return {
|
||||||
tanks: isObject(object.tanks)
|
tanks: isObject(object.tanks)
|
||||||
? (globalThis.Object.entries(object.tanks) as [string, any][]).reduce(
|
? Object.entries(object.tanks).reduce<{ [key: number]: TankDefinition }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: TankDefinition }, [key, value]: [string, any]) => {
|
acc[globalThis.Number(key)] = TankDefinition.fromJSON(value);
|
||||||
acc[globalThis.Number(key)] = TankDefinition.fromJSON(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -513,7 +510,7 @@ export const TankDefinitions: MessageFns<TankDefinitions> = {
|
|||||||
toJSON(message: TankDefinitions): unknown {
|
toJSON(message: TankDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.tanks) {
|
if (message.tanks) {
|
||||||
const entries = globalThis.Object.entries(message.tanks) as [string, TankDefinition][];
|
const entries = Object.entries(message.tanks);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.tanks = {};
|
obj.tanks = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -529,8 +526,8 @@ export const TankDefinitions: MessageFns<TankDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<TankDefinitions>, I>>(object: I): TankDefinitions {
|
fromPartial<I extends Exact<DeepPartial<TankDefinitions>, I>>(object: I): TankDefinitions {
|
||||||
const message = createBaseTankDefinitions();
|
const message = createBaseTankDefinitions();
|
||||||
message.tanks = (globalThis.Object.entries(object.tanks ?? {}) as [string, TankDefinition][]).reduce(
|
message.tanks = Object.entries(object.tanks ?? {}).reduce<{ [key: number]: TankDefinition }>(
|
||||||
(acc: { [key: number]: TankDefinition }, [key, value]: [string, TankDefinition]) => {
|
(acc, [key, value]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = TankDefinition.fromPartial(value);
|
acc[globalThis.Number(key)] = TankDefinition.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -665,7 +662,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
if (message.slug !== "") {
|
if (message.slug !== "") {
|
||||||
writer.uint32(18).string(message.slug);
|
writer.uint32(18).string(message.slug);
|
||||||
}
|
}
|
||||||
globalThis.Object.entries(message.roles).forEach(([key, value]: [string, number]) => {
|
Object.entries(message.roles).forEach(([key, value]) => {
|
||||||
TankDefinition_RolesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
TankDefinition_RolesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
||||||
});
|
});
|
||||||
if (message.fixed_camouflage !== false) {
|
if (message.fixed_camouflage !== false) {
|
||||||
@@ -1068,19 +1065,12 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
|
slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
|
||||||
roles: isObject(object.roles)
|
roles: isObject(object.roles)
|
||||||
? (globalThis.Object.entries(object.roles) as [string, any][]).reduce(
|
? Object.entries(object.roles).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: number }, [key, value]: [string, any]) => {
|
acc[key] = Number(value);
|
||||||
acc[globalThis.Number(key)] = globalThis.Number(value);
|
return acc;
|
||||||
return acc;
|
}, {})
|
||||||
},
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {},
|
: {},
|
||||||
fixed_camouflage: isSet(object.fixedCamouflage)
|
fixed_camouflage: isSet(object.fixed_camouflage) ? globalThis.Boolean(object.fixed_camouflage) : false,
|
||||||
? globalThis.Boolean(object.fixedCamouflage)
|
|
||||||
: isSet(object.fixed_camouflage)
|
|
||||||
? globalThis.Boolean(object.fixed_camouflage)
|
|
||||||
: false,
|
|
||||||
camouflages: globalThis.Array.isArray(object?.camouflages)
|
camouflages: globalThis.Array.isArray(object?.camouflages)
|
||||||
? object.camouflages.map((e: any) => globalThis.Number(e))
|
? object.camouflages.map((e: any) => globalThis.Number(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -1090,23 +1080,13 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
successors: globalThis.Array.isArray(object?.successors)
|
successors: globalThis.Array.isArray(object?.successors)
|
||||||
? object.successors.map((e: any) => globalThis.Number(e))
|
? object.successors.map((e: any) => globalThis.Number(e))
|
||||||
: [],
|
: [],
|
||||||
crew: globalThis.Array.isArray(object?.crew)
|
crew: globalThis.Array.isArray(object?.crew) ? object.crew.map((e: any) => Crew.fromJSON(e)) : [],
|
||||||
? object.crew.map((e: any) => Crew.fromJSON(e))
|
|
||||||
: [],
|
|
||||||
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
||||||
nation: isSet(object.nation) ? globalThis.String(object.nation) : "",
|
nation: isSet(object.nation) ? globalThis.String(object.nation) : "",
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
type: isSet(object.type) ? tankTypeFromJSON(object.type) : 0,
|
type: isSet(object.type) ? tankTypeFromJSON(object.type) : 0,
|
||||||
max_consumables: isSet(object.maxConsumables)
|
max_consumables: isSet(object.max_consumables) ? globalThis.Number(object.max_consumables) : 0,
|
||||||
? globalThis.Number(object.maxConsumables)
|
max_provisions: isSet(object.max_provisions) ? globalThis.Number(object.max_provisions) : 0,
|
||||||
: isSet(object.max_consumables)
|
|
||||||
? globalThis.Number(object.max_consumables)
|
|
||||||
: 0,
|
|
||||||
max_provisions: isSet(object.maxProvisions)
|
|
||||||
? globalThis.Number(object.maxProvisions)
|
|
||||||
: isSet(object.max_provisions)
|
|
||||||
? globalThis.Number(object.max_provisions)
|
|
||||||
: 0,
|
|
||||||
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
||||||
class: isSet(object.class) ? tankClassFromJSON(object.class) : 0,
|
class: isSet(object.class) ? tankClassFromJSON(object.class) : 0,
|
||||||
testing: isSet(object.testing) ? globalThis.Boolean(object.testing) : false,
|
testing: isSet(object.testing) ? globalThis.Boolean(object.testing) : false,
|
||||||
@@ -1121,47 +1101,15 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
? object.tracks.map((e: any) => TrackDefinition.fromJSON(e))
|
? object.tracks.map((e: any) => TrackDefinition.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
price: isSet(object.price) ? TankPrice.fromJSON(object.price) : undefined,
|
price: isSet(object.price) ? TankPrice.fromJSON(object.price) : undefined,
|
||||||
research_cost: isSet(object.researchCost)
|
research_cost: isSet(object.research_cost) ? ResearchCost.fromJSON(object.research_cost) : undefined,
|
||||||
? ResearchCost.fromJSON(object.researchCost)
|
speed_forwards: isSet(object.speed_forwards) ? globalThis.Number(object.speed_forwards) : 0,
|
||||||
: isSet(object.research_cost)
|
speed_backwards: isSet(object.speed_backwards) ? globalThis.Number(object.speed_backwards) : 0,
|
||||||
? ResearchCost.fromJSON(object.research_cost)
|
camouflage_still: isSet(object.camouflage_still) ? globalThis.Number(object.camouflage_still) : 0,
|
||||||
: undefined,
|
camouflage_moving: isSet(object.camouflage_moving) ? globalThis.Number(object.camouflage_moving) : 0,
|
||||||
speed_forwards: isSet(object.speedForwards)
|
camouflage_on_fire: isSet(object.camouflage_on_fire) ? globalThis.Number(object.camouflage_on_fire) : 0,
|
||||||
? globalThis.Number(object.speedForwards)
|
equipment_preset: isSet(object.equipment_preset) ? globalThis.String(object.equipment_preset) : "",
|
||||||
: isSet(object.speed_forwards)
|
|
||||||
? globalThis.Number(object.speed_forwards)
|
|
||||||
: 0,
|
|
||||||
speed_backwards: isSet(object.speedBackwards)
|
|
||||||
? globalThis.Number(object.speedBackwards)
|
|
||||||
: isSet(object.speed_backwards)
|
|
||||||
? globalThis.Number(object.speed_backwards)
|
|
||||||
: 0,
|
|
||||||
camouflage_still: isSet(object.camouflageStill)
|
|
||||||
? globalThis.Number(object.camouflageStill)
|
|
||||||
: isSet(object.camouflage_still)
|
|
||||||
? globalThis.Number(object.camouflage_still)
|
|
||||||
: 0,
|
|
||||||
camouflage_moving: isSet(object.camouflageMoving)
|
|
||||||
? globalThis.Number(object.camouflageMoving)
|
|
||||||
: isSet(object.camouflage_moving)
|
|
||||||
? globalThis.Number(object.camouflage_moving)
|
|
||||||
: 0,
|
|
||||||
camouflage_on_fire: isSet(object.camouflageOnFire)
|
|
||||||
? globalThis.Number(object.camouflageOnFire)
|
|
||||||
: isSet(object.camouflage_on_fire)
|
|
||||||
? globalThis.Number(object.camouflage_on_fire)
|
|
||||||
: 0,
|
|
||||||
equipment_preset: isSet(object.equipmentPreset)
|
|
||||||
? globalThis.String(object.equipmentPreset)
|
|
||||||
: isSet(object.equipment_preset)
|
|
||||||
? globalThis.String(object.equipment_preset)
|
|
||||||
: "",
|
|
||||||
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
||||||
dev_name: isSet(object.devName)
|
dev_name: isSet(object.dev_name) ? globalThis.String(object.dev_name) : "",
|
||||||
? globalThis.String(object.devName)
|
|
||||||
: isSet(object.dev_name)
|
|
||||||
? globalThis.String(object.dev_name)
|
|
||||||
: "",
|
|
||||||
equalizer: isSet(object.equalizer) ? Equalizer.fromJSON(object.equalizer) : undefined,
|
equalizer: isSet(object.equalizer) ? Equalizer.fromJSON(object.equalizer) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -1175,7 +1123,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
obj.slug = message.slug;
|
obj.slug = message.slug;
|
||||||
}
|
}
|
||||||
if (message.roles) {
|
if (message.roles) {
|
||||||
const entries = globalThis.Object.entries(message.roles) as [string, number][];
|
const entries = Object.entries(message.roles);
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.roles = {};
|
obj.roles = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -1184,7 +1132,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.fixed_camouflage !== false) {
|
if (message.fixed_camouflage !== false) {
|
||||||
obj.fixedCamouflage = message.fixed_camouflage;
|
obj.fixed_camouflage = message.fixed_camouflage;
|
||||||
}
|
}
|
||||||
if (message.camouflages?.length) {
|
if (message.camouflages?.length) {
|
||||||
obj.camouflages = message.camouflages.map((e) => Math.round(e));
|
obj.camouflages = message.camouflages.map((e) => Math.round(e));
|
||||||
@@ -1211,10 +1159,10 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
obj.type = tankTypeToJSON(message.type);
|
obj.type = tankTypeToJSON(message.type);
|
||||||
}
|
}
|
||||||
if (message.max_consumables !== 0) {
|
if (message.max_consumables !== 0) {
|
||||||
obj.maxConsumables = Math.round(message.max_consumables);
|
obj.max_consumables = Math.round(message.max_consumables);
|
||||||
}
|
}
|
||||||
if (message.max_provisions !== 0) {
|
if (message.max_provisions !== 0) {
|
||||||
obj.maxProvisions = Math.round(message.max_provisions);
|
obj.max_provisions = Math.round(message.max_provisions);
|
||||||
}
|
}
|
||||||
if (message.tier !== 0) {
|
if (message.tier !== 0) {
|
||||||
obj.tier = Math.round(message.tier);
|
obj.tier = Math.round(message.tier);
|
||||||
@@ -1241,31 +1189,31 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
obj.price = TankPrice.toJSON(message.price);
|
obj.price = TankPrice.toJSON(message.price);
|
||||||
}
|
}
|
||||||
if (message.research_cost !== undefined) {
|
if (message.research_cost !== undefined) {
|
||||||
obj.researchCost = ResearchCost.toJSON(message.research_cost);
|
obj.research_cost = ResearchCost.toJSON(message.research_cost);
|
||||||
}
|
}
|
||||||
if (message.speed_forwards !== 0) {
|
if (message.speed_forwards !== 0) {
|
||||||
obj.speedForwards = message.speed_forwards;
|
obj.speed_forwards = message.speed_forwards;
|
||||||
}
|
}
|
||||||
if (message.speed_backwards !== 0) {
|
if (message.speed_backwards !== 0) {
|
||||||
obj.speedBackwards = message.speed_backwards;
|
obj.speed_backwards = message.speed_backwards;
|
||||||
}
|
}
|
||||||
if (message.camouflage_still !== 0) {
|
if (message.camouflage_still !== 0) {
|
||||||
obj.camouflageStill = message.camouflage_still;
|
obj.camouflage_still = message.camouflage_still;
|
||||||
}
|
}
|
||||||
if (message.camouflage_moving !== 0) {
|
if (message.camouflage_moving !== 0) {
|
||||||
obj.camouflageMoving = message.camouflage_moving;
|
obj.camouflage_moving = message.camouflage_moving;
|
||||||
}
|
}
|
||||||
if (message.camouflage_on_fire !== 0) {
|
if (message.camouflage_on_fire !== 0) {
|
||||||
obj.camouflageOnFire = message.camouflage_on_fire;
|
obj.camouflage_on_fire = message.camouflage_on_fire;
|
||||||
}
|
}
|
||||||
if (message.equipment_preset !== "") {
|
if (message.equipment_preset !== "") {
|
||||||
obj.equipmentPreset = message.equipment_preset;
|
obj.equipment_preset = message.equipment_preset;
|
||||||
}
|
}
|
||||||
if (message.weight !== 0) {
|
if (message.weight !== 0) {
|
||||||
obj.weight = Math.round(message.weight);
|
obj.weight = Math.round(message.weight);
|
||||||
}
|
}
|
||||||
if (message.dev_name !== "") {
|
if (message.dev_name !== "") {
|
||||||
obj.devName = message.dev_name;
|
obj.dev_name = message.dev_name;
|
||||||
}
|
}
|
||||||
if (message.equalizer !== undefined) {
|
if (message.equalizer !== undefined) {
|
||||||
obj.equalizer = Equalizer.toJSON(message.equalizer);
|
obj.equalizer = Equalizer.toJSON(message.equalizer);
|
||||||
@@ -1280,15 +1228,12 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
const message = createBaseTankDefinition();
|
const message = createBaseTankDefinition();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.slug = object.slug ?? "";
|
message.slug = object.slug ?? "";
|
||||||
message.roles = (globalThis.Object.entries(object.roles ?? {}) as [string, number][]).reduce(
|
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
||||||
(acc: { [key: number]: number }, [key, value]: [string, number]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[key] = globalThis.Number(value);
|
||||||
acc[globalThis.Number(key)] = globalThis.Number(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
}, {});
|
||||||
},
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
message.fixed_camouflage = object.fixed_camouflage ?? false;
|
message.fixed_camouflage = object.fixed_camouflage ?? false;
|
||||||
message.camouflages = object.camouflages?.map((e) => e) || [];
|
message.camouflages = object.camouflages?.map((e) => e) || [];
|
||||||
message.ancestors = object.ancestors?.map((e) => e) || [];
|
message.ancestors = object.ancestors?.map((e) => e) || [];
|
||||||
@@ -1331,13 +1276,13 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function createBaseTankDefinition_RolesEntry(): TankDefinition_RolesEntry {
|
function createBaseTankDefinition_RolesEntry(): TankDefinition_RolesEntry {
|
||||||
return { key: 0, value: 0 };
|
return { key: "", value: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> = {
|
export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> = {
|
||||||
encode(message: TankDefinition_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: TankDefinition_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== 0) {
|
if (message.key !== "") {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(10).string(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== 0) {
|
if (message.value !== 0) {
|
||||||
writer.uint32(16).uint32(message.value);
|
writer.uint32(16).uint32(message.value);
|
||||||
@@ -1353,11 +1298,11 @@ export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> =
|
|||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
switch (tag >>> 3) {
|
switch (tag >>> 3) {
|
||||||
case 1: {
|
case 1: {
|
||||||
if (tag !== 8) {
|
if (tag !== 10) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.key = reader.uint32();
|
message.key = reader.string();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
@@ -1379,15 +1324,15 @@ export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> =
|
|||||||
|
|
||||||
fromJSON(object: any): TankDefinition_RolesEntry {
|
fromJSON(object: any): TankDefinition_RolesEntry {
|
||||||
return {
|
return {
|
||||||
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||||
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: TankDefinition_RolesEntry): unknown {
|
toJSON(message: TankDefinition_RolesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== 0) {
|
if (message.key !== "") {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = message.key;
|
||||||
}
|
}
|
||||||
if (message.value !== 0) {
|
if (message.value !== 0) {
|
||||||
obj.value = Math.round(message.value);
|
obj.value = Math.round(message.value);
|
||||||
@@ -1400,7 +1345,7 @@ export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> =
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<TankDefinition_RolesEntry>, I>>(object: I): TankDefinition_RolesEntry {
|
fromPartial<I extends Exact<DeepPartial<TankDefinition_RolesEntry>, I>>(object: I): TankDefinition_RolesEntry {
|
||||||
const message = createBaseTankDefinition_RolesEntry();
|
const message = createBaseTankDefinition_RolesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? "";
|
||||||
message.value = object.value ?? 0;
|
message.value = object.value ?? 0;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
@@ -1490,11 +1435,7 @@ export const Equalizer: MessageFns<Equalizer> = {
|
|||||||
return {
|
return {
|
||||||
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
||||||
penetration: isSet(object.penetration) ? globalThis.Number(object.penetration) : 0,
|
penetration: isSet(object.penetration) ? globalThis.Number(object.penetration) : 0,
|
||||||
module_health: isSet(object.moduleHealth)
|
module_health: isSet(object.module_health) ? globalThis.Number(object.module_health) : 0,
|
||||||
? globalThis.Number(object.moduleHealth)
|
|
||||||
: isSet(object.module_health)
|
|
||||||
? globalThis.Number(object.module_health)
|
|
||||||
: 0,
|
|
||||||
damage: isSet(object.damage) ? globalThis.Number(object.damage) : 0,
|
damage: isSet(object.damage) ? globalThis.Number(object.damage) : 0,
|
||||||
armor: isSet(object.armor) ? globalThis.Number(object.armor) : 0,
|
armor: isSet(object.armor) ? globalThis.Number(object.armor) : 0,
|
||||||
};
|
};
|
||||||
@@ -1509,7 +1450,7 @@ export const Equalizer: MessageFns<Equalizer> = {
|
|||||||
obj.penetration = message.penetration;
|
obj.penetration = message.penetration;
|
||||||
}
|
}
|
||||||
if (message.module_health !== 0) {
|
if (message.module_health !== 0) {
|
||||||
obj.moduleHealth = message.module_health;
|
obj.module_health = message.module_health;
|
||||||
}
|
}
|
||||||
if (message.damage !== 0) {
|
if (message.damage !== 0) {
|
||||||
obj.damage = message.damage;
|
obj.damage = message.damage;
|
||||||
@@ -1590,8 +1531,6 @@ export const ResearchCost: MessageFns<ResearchCost> = {
|
|||||||
return {
|
return {
|
||||||
research_cost_type: isSet(object.xp)
|
research_cost_type: isSet(object.xp)
|
||||||
? { $case: "xp", value: globalThis.Number(object.xp) }
|
? { $case: "xp", value: globalThis.Number(object.xp) }
|
||||||
: isSet(object.seasonalTokens)
|
|
||||||
? { $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.fromJSON(object.seasonalTokens) }
|
|
||||||
: isSet(object.seasonal_tokens)
|
: isSet(object.seasonal_tokens)
|
||||||
? { $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.fromJSON(object.seasonal_tokens) }
|
? { $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.fromJSON(object.seasonal_tokens) }
|
||||||
: undefined,
|
: undefined,
|
||||||
@@ -1603,7 +1542,7 @@ export const ResearchCost: MessageFns<ResearchCost> = {
|
|||||||
if (message.research_cost_type?.$case === "xp") {
|
if (message.research_cost_type?.$case === "xp") {
|
||||||
obj.xp = Math.round(message.research_cost_type.value);
|
obj.xp = Math.round(message.research_cost_type.value);
|
||||||
} else if (message.research_cost_type?.$case === "seasonal_tokens") {
|
} else if (message.research_cost_type?.$case === "seasonal_tokens") {
|
||||||
obj.seasonalTokens = ResearchCostSeasonalTokens.toJSON(message.research_cost_type.value);
|
obj.seasonal_tokens = ResearchCostSeasonalTokens.toJSON(message.research_cost_type.value);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -1962,44 +1901,14 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
|
|||||||
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
||||||
traverse_speed: isSet(object.traverseSpeed)
|
traverse_speed: isSet(object.traverse_speed) ? globalThis.Number(object.traverse_speed) : 0,
|
||||||
? globalThis.Number(object.traverseSpeed)
|
research_cost: isSet(object.research_cost) ? ResearchCost.fromJSON(object.research_cost) : undefined,
|
||||||
: isSet(object.traverse_speed)
|
dispersion_move: isSet(object.dispersion_move) ? globalThis.Number(object.dispersion_move) : 0,
|
||||||
? globalThis.Number(object.traverse_speed)
|
dispersion_traverse: isSet(object.dispersion_traverse) ? globalThis.Number(object.dispersion_traverse) : 0,
|
||||||
: 0,
|
resistance_hard: isSet(object.resistance_hard) ? globalThis.Number(object.resistance_hard) : 0,
|
||||||
research_cost: isSet(object.researchCost)
|
resistance_medium: isSet(object.resistance_medium) ? globalThis.Number(object.resistance_medium) : 0,
|
||||||
? ResearchCost.fromJSON(object.researchCost)
|
resistance_soft: isSet(object.resistance_soft) ? globalThis.Number(object.resistance_soft) : 0,
|
||||||
: isSet(object.research_cost)
|
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
||||||
? ResearchCost.fromJSON(object.research_cost)
|
|
||||||
: undefined,
|
|
||||||
dispersion_move: isSet(object.dispersionMove)
|
|
||||||
? globalThis.Number(object.dispersionMove)
|
|
||||||
: isSet(object.dispersion_move)
|
|
||||||
? globalThis.Number(object.dispersion_move)
|
|
||||||
: 0,
|
|
||||||
dispersion_traverse: isSet(object.dispersionTraverse)
|
|
||||||
? globalThis.Number(object.dispersionTraverse)
|
|
||||||
: isSet(object.dispersion_traverse)
|
|
||||||
? globalThis.Number(object.dispersion_traverse)
|
|
||||||
: 0,
|
|
||||||
resistance_hard: isSet(object.resistanceHard)
|
|
||||||
? globalThis.Number(object.resistanceHard)
|
|
||||||
: isSet(object.resistance_hard)
|
|
||||||
? globalThis.Number(object.resistance_hard)
|
|
||||||
: 0,
|
|
||||||
resistance_medium: isSet(object.resistanceMedium)
|
|
||||||
? globalThis.Number(object.resistanceMedium)
|
|
||||||
: isSet(object.resistance_medium)
|
|
||||||
? globalThis.Number(object.resistance_medium)
|
|
||||||
: 0,
|
|
||||||
resistance_soft: isSet(object.resistanceSoft)
|
|
||||||
? globalThis.Number(object.resistanceSoft)
|
|
||||||
: isSet(object.resistance_soft)
|
|
||||||
? globalThis.Number(object.resistance_soft)
|
|
||||||
: 0,
|
|
||||||
unlocks: globalThis.Array.isArray(object?.unlocks)
|
|
||||||
? object.unlocks.map((e: any) => Unlock.fromJSON(e))
|
|
||||||
: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2018,25 +1927,25 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
|
|||||||
obj.weight = Math.round(message.weight);
|
obj.weight = Math.round(message.weight);
|
||||||
}
|
}
|
||||||
if (message.traverse_speed !== 0) {
|
if (message.traverse_speed !== 0) {
|
||||||
obj.traverseSpeed = message.traverse_speed;
|
obj.traverse_speed = message.traverse_speed;
|
||||||
}
|
}
|
||||||
if (message.research_cost !== undefined) {
|
if (message.research_cost !== undefined) {
|
||||||
obj.researchCost = ResearchCost.toJSON(message.research_cost);
|
obj.research_cost = ResearchCost.toJSON(message.research_cost);
|
||||||
}
|
}
|
||||||
if (message.dispersion_move !== 0) {
|
if (message.dispersion_move !== 0) {
|
||||||
obj.dispersionMove = message.dispersion_move;
|
obj.dispersion_move = message.dispersion_move;
|
||||||
}
|
}
|
||||||
if (message.dispersion_traverse !== 0) {
|
if (message.dispersion_traverse !== 0) {
|
||||||
obj.dispersionTraverse = message.dispersion_traverse;
|
obj.dispersion_traverse = message.dispersion_traverse;
|
||||||
}
|
}
|
||||||
if (message.resistance_hard !== 0) {
|
if (message.resistance_hard !== 0) {
|
||||||
obj.resistanceHard = message.resistance_hard;
|
obj.resistance_hard = message.resistance_hard;
|
||||||
}
|
}
|
||||||
if (message.resistance_medium !== 0) {
|
if (message.resistance_medium !== 0) {
|
||||||
obj.resistanceMedium = message.resistance_medium;
|
obj.resistance_medium = message.resistance_medium;
|
||||||
}
|
}
|
||||||
if (message.resistance_soft !== 0) {
|
if (message.resistance_soft !== 0) {
|
||||||
obj.resistanceSoft = message.resistance_soft;
|
obj.resistance_soft = message.resistance_soft;
|
||||||
}
|
}
|
||||||
if (message.unlocks?.length) {
|
if (message.unlocks?.length) {
|
||||||
obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e));
|
obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e));
|
||||||
@@ -2195,17 +2104,9 @@ export const EngineDefinition: MessageFns<EngineDefinition> = {
|
|||||||
return {
|
return {
|
||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
research_cost: isSet(object.researchCost)
|
research_cost: isSet(object.research_cost) ? ResearchCost.fromJSON(object.research_cost) : undefined,
|
||||||
? ResearchCost.fromJSON(object.researchCost)
|
|
||||||
: isSet(object.research_cost)
|
|
||||||
? ResearchCost.fromJSON(object.research_cost)
|
|
||||||
: undefined,
|
|
||||||
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
||||||
fire_chance: isSet(object.fireChance)
|
fire_chance: isSet(object.fire_chance) ? globalThis.Number(object.fire_chance) : 0,
|
||||||
? globalThis.Number(object.fireChance)
|
|
||||||
: isSet(object.fire_chance)
|
|
||||||
? globalThis.Number(object.fire_chance)
|
|
||||||
: 0,
|
|
||||||
power: isSet(object.power) ? globalThis.Number(object.power) : 0,
|
power: isSet(object.power) ? globalThis.Number(object.power) : 0,
|
||||||
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
||||||
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
||||||
@@ -2221,13 +2122,13 @@ export const EngineDefinition: MessageFns<EngineDefinition> = {
|
|||||||
obj.name = I18nString.toJSON(message.name);
|
obj.name = I18nString.toJSON(message.name);
|
||||||
}
|
}
|
||||||
if (message.research_cost !== undefined) {
|
if (message.research_cost !== undefined) {
|
||||||
obj.researchCost = ResearchCost.toJSON(message.research_cost);
|
obj.research_cost = ResearchCost.toJSON(message.research_cost);
|
||||||
}
|
}
|
||||||
if (message.tier !== 0) {
|
if (message.tier !== 0) {
|
||||||
obj.tier = Math.round(message.tier);
|
obj.tier = Math.round(message.tier);
|
||||||
}
|
}
|
||||||
if (message.fire_chance !== 0) {
|
if (message.fire_chance !== 0) {
|
||||||
obj.fireChance = message.fire_chance;
|
obj.fire_chance = message.fire_chance;
|
||||||
}
|
}
|
||||||
if (message.power !== 0) {
|
if (message.power !== 0) {
|
||||||
obj.power = Math.round(message.power);
|
obj.power = Math.round(message.power);
|
||||||
@@ -2412,27 +2313,13 @@ export const TurretDefinition: MessageFns<TurretDefinition> = {
|
|||||||
return {
|
return {
|
||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
||||||
view_range: isSet(object.viewRange)
|
view_range: isSet(object.view_range) ? globalThis.Number(object.view_range) : 0,
|
||||||
? globalThis.Number(object.viewRange)
|
traverse_speed: isSet(object.traverse_speed) ? globalThis.Number(object.traverse_speed) : 0,
|
||||||
: isSet(object.view_range)
|
research_cost: isSet(object.research_cost) ? ResearchCost.fromJSON(object.research_cost) : undefined,
|
||||||
? globalThis.Number(object.view_range)
|
|
||||||
: 0,
|
|
||||||
traverse_speed: isSet(object.traverseSpeed)
|
|
||||||
? globalThis.Number(object.traverseSpeed)
|
|
||||||
: isSet(object.traverse_speed)
|
|
||||||
? globalThis.Number(object.traverse_speed)
|
|
||||||
: 0,
|
|
||||||
research_cost: isSet(object.researchCost)
|
|
||||||
? ResearchCost.fromJSON(object.researchCost)
|
|
||||||
: isSet(object.research_cost)
|
|
||||||
? ResearchCost.fromJSON(object.research_cost)
|
|
||||||
: undefined,
|
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
||||||
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
||||||
guns: globalThis.Array.isArray(object?.guns)
|
guns: globalThis.Array.isArray(object?.guns) ? object.guns.map((e: any) => GunDefinition.fromJSON(e)) : [],
|
||||||
? object.guns.map((e: any) => GunDefinition.fromJSON(e))
|
|
||||||
: [],
|
|
||||||
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -2446,13 +2333,13 @@ export const TurretDefinition: MessageFns<TurretDefinition> = {
|
|||||||
obj.health = Math.round(message.health);
|
obj.health = Math.round(message.health);
|
||||||
}
|
}
|
||||||
if (message.view_range !== 0) {
|
if (message.view_range !== 0) {
|
||||||
obj.viewRange = Math.round(message.view_range);
|
obj.view_range = Math.round(message.view_range);
|
||||||
}
|
}
|
||||||
if (message.traverse_speed !== 0) {
|
if (message.traverse_speed !== 0) {
|
||||||
obj.traverseSpeed = message.traverse_speed;
|
obj.traverse_speed = message.traverse_speed;
|
||||||
}
|
}
|
||||||
if (message.research_cost !== undefined) {
|
if (message.research_cost !== undefined) {
|
||||||
obj.researchCost = ResearchCost.toJSON(message.research_cost);
|
obj.research_cost = ResearchCost.toJSON(message.research_cost);
|
||||||
}
|
}
|
||||||
if (message.name !== undefined) {
|
if (message.name !== undefined) {
|
||||||
obj.name = I18nString.toJSON(message.name);
|
obj.name = I18nString.toJSON(message.name);
|
||||||
@@ -2768,75 +2655,29 @@ export const GunDefinition: MessageFns<GunDefinition> = {
|
|||||||
return {
|
return {
|
||||||
gun_type: isSet(object.regular)
|
gun_type: isSet(object.regular)
|
||||||
? { $case: "regular", value: GunDefinitionRegular.fromJSON(object.regular) }
|
? { $case: "regular", value: GunDefinitionRegular.fromJSON(object.regular) }
|
||||||
: isSet(object.autoLoader)
|
|
||||||
? { $case: "auto_loader", value: GunDefinitionAutoLoader.fromJSON(object.autoLoader) }
|
|
||||||
: isSet(object.auto_loader)
|
: isSet(object.auto_loader)
|
||||||
? { $case: "auto_loader", value: GunDefinitionAutoLoader.fromJSON(object.auto_loader) }
|
? { $case: "auto_loader", value: GunDefinitionAutoLoader.fromJSON(object.auto_loader) }
|
||||||
: isSet(object.autoReloader)
|
|
||||||
? { $case: "auto_reloader", value: GunDefinitionAutoReloader.fromJSON(object.autoReloader) }
|
|
||||||
: isSet(object.auto_reloader)
|
: isSet(object.auto_reloader)
|
||||||
? { $case: "auto_reloader", value: GunDefinitionAutoReloader.fromJSON(object.auto_reloader) }
|
? { $case: "auto_reloader", value: GunDefinitionAutoReloader.fromJSON(object.auto_reloader) }
|
||||||
: undefined,
|
: undefined,
|
||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
rotation_speed: isSet(object.rotationSpeed)
|
rotation_speed: isSet(object.rotation_speed) ? globalThis.Number(object.rotation_speed) : 0,
|
||||||
? globalThis.Number(object.rotationSpeed)
|
research_cost: isSet(object.research_cost) ? ResearchCost.fromJSON(object.research_cost) : undefined,
|
||||||
: isSet(object.rotation_speed)
|
|
||||||
? globalThis.Number(object.rotation_speed)
|
|
||||||
: 0,
|
|
||||||
research_cost: isSet(object.researchCost)
|
|
||||||
? ResearchCost.fromJSON(object.researchCost)
|
|
||||||
: isSet(object.research_cost)
|
|
||||||
? ResearchCost.fromJSON(object.research_cost)
|
|
||||||
: undefined,
|
|
||||||
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
tier: isSet(object.tier) ? globalThis.Number(object.tier) : 0,
|
||||||
shells: globalThis.Array.isArray(object?.shells)
|
shells: globalThis.Array.isArray(object?.shells)
|
||||||
? object.shells.map((e: any) => ShellDefinition.fromJSON(e))
|
? object.shells.map((e: any) => ShellDefinition.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
camouflage_loss: isSet(object.camouflageLoss)
|
camouflage_loss: isSet(object.camouflage_loss) ? globalThis.Number(object.camouflage_loss) : 0,
|
||||||
? globalThis.Number(object.camouflageLoss)
|
aim_time: isSet(object.aim_time) ? globalThis.Number(object.aim_time) : 0,
|
||||||
: isSet(object.camouflage_loss)
|
dispersion_base: isSet(object.dispersion_base) ? globalThis.Number(object.dispersion_base) : 0,
|
||||||
? globalThis.Number(object.camouflage_loss)
|
dispersion_traverse: isSet(object.dispersion_traverse) ? globalThis.Number(object.dispersion_traverse) : 0,
|
||||||
: 0,
|
dispersion_shot: isSet(object.dispersion_shot) ? globalThis.Number(object.dispersion_shot) : 0,
|
||||||
aim_time: isSet(object.aimTime)
|
dispersion_damaged: isSet(object.dispersion_damaged) ? globalThis.Number(object.dispersion_damaged) : 0,
|
||||||
? globalThis.Number(object.aimTime)
|
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
|
||||||
: isSet(object.aim_time)
|
shell_capacity: isSet(object.shell_capacity) ? globalThis.Number(object.shell_capacity) : 0,
|
||||||
? globalThis.Number(object.aim_time)
|
assault_ranges: isSet(object.assault_ranges) ? AssaultRanges.fromJSON(object.assault_ranges) : undefined,
|
||||||
: 0,
|
|
||||||
dispersion_base: isSet(object.dispersionBase)
|
|
||||||
? globalThis.Number(object.dispersionBase)
|
|
||||||
: isSet(object.dispersion_base)
|
|
||||||
? globalThis.Number(object.dispersion_base)
|
|
||||||
: 0,
|
|
||||||
dispersion_traverse: isSet(object.dispersionTraverse)
|
|
||||||
? globalThis.Number(object.dispersionTraverse)
|
|
||||||
: isSet(object.dispersion_traverse)
|
|
||||||
? globalThis.Number(object.dispersion_traverse)
|
|
||||||
: 0,
|
|
||||||
dispersion_shot: isSet(object.dispersionShot)
|
|
||||||
? globalThis.Number(object.dispersionShot)
|
|
||||||
: isSet(object.dispersion_shot)
|
|
||||||
? globalThis.Number(object.dispersion_shot)
|
|
||||||
: 0,
|
|
||||||
dispersion_damaged: isSet(object.dispersionDamaged)
|
|
||||||
? globalThis.Number(object.dispersionDamaged)
|
|
||||||
: isSet(object.dispersion_damaged)
|
|
||||||
? globalThis.Number(object.dispersion_damaged)
|
|
||||||
: 0,
|
|
||||||
unlocks: globalThis.Array.isArray(object?.unlocks)
|
|
||||||
? object.unlocks.map((e: any) => Unlock.fromJSON(e))
|
|
||||||
: [],
|
|
||||||
shell_capacity: isSet(object.shellCapacity)
|
|
||||||
? globalThis.Number(object.shellCapacity)
|
|
||||||
: isSet(object.shell_capacity)
|
|
||||||
? globalThis.Number(object.shell_capacity)
|
|
||||||
: 0,
|
|
||||||
assault_ranges: isSet(object.assaultRanges)
|
|
||||||
? AssaultRanges.fromJSON(object.assaultRanges)
|
|
||||||
: isSet(object.assault_ranges)
|
|
||||||
? AssaultRanges.fromJSON(object.assault_ranges)
|
|
||||||
: undefined,
|
|
||||||
burst: isSet(object.burst) ? Burst.fromJSON(object.burst) : undefined,
|
burst: isSet(object.burst) ? Burst.fromJSON(object.burst) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -2846,18 +2687,18 @@ export const GunDefinition: MessageFns<GunDefinition> = {
|
|||||||
if (message.gun_type?.$case === "regular") {
|
if (message.gun_type?.$case === "regular") {
|
||||||
obj.regular = GunDefinitionRegular.toJSON(message.gun_type.value);
|
obj.regular = GunDefinitionRegular.toJSON(message.gun_type.value);
|
||||||
} else if (message.gun_type?.$case === "auto_loader") {
|
} else if (message.gun_type?.$case === "auto_loader") {
|
||||||
obj.autoLoader = GunDefinitionAutoLoader.toJSON(message.gun_type.value);
|
obj.auto_loader = GunDefinitionAutoLoader.toJSON(message.gun_type.value);
|
||||||
} else if (message.gun_type?.$case === "auto_reloader") {
|
} else if (message.gun_type?.$case === "auto_reloader") {
|
||||||
obj.autoReloader = GunDefinitionAutoReloader.toJSON(message.gun_type.value);
|
obj.auto_reloader = GunDefinitionAutoReloader.toJSON(message.gun_type.value);
|
||||||
}
|
}
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
obj.id = Math.round(message.id);
|
obj.id = Math.round(message.id);
|
||||||
}
|
}
|
||||||
if (message.rotation_speed !== 0) {
|
if (message.rotation_speed !== 0) {
|
||||||
obj.rotationSpeed = message.rotation_speed;
|
obj.rotation_speed = message.rotation_speed;
|
||||||
}
|
}
|
||||||
if (message.research_cost !== undefined) {
|
if (message.research_cost !== undefined) {
|
||||||
obj.researchCost = ResearchCost.toJSON(message.research_cost);
|
obj.research_cost = ResearchCost.toJSON(message.research_cost);
|
||||||
}
|
}
|
||||||
if (message.weight !== 0) {
|
if (message.weight !== 0) {
|
||||||
obj.weight = Math.round(message.weight);
|
obj.weight = Math.round(message.weight);
|
||||||
@@ -2872,31 +2713,31 @@ export const GunDefinition: MessageFns<GunDefinition> = {
|
|||||||
obj.shells = message.shells.map((e) => ShellDefinition.toJSON(e));
|
obj.shells = message.shells.map((e) => ShellDefinition.toJSON(e));
|
||||||
}
|
}
|
||||||
if (message.camouflage_loss !== 0) {
|
if (message.camouflage_loss !== 0) {
|
||||||
obj.camouflageLoss = message.camouflage_loss;
|
obj.camouflage_loss = message.camouflage_loss;
|
||||||
}
|
}
|
||||||
if (message.aim_time !== 0) {
|
if (message.aim_time !== 0) {
|
||||||
obj.aimTime = message.aim_time;
|
obj.aim_time = message.aim_time;
|
||||||
}
|
}
|
||||||
if (message.dispersion_base !== 0) {
|
if (message.dispersion_base !== 0) {
|
||||||
obj.dispersionBase = message.dispersion_base;
|
obj.dispersion_base = message.dispersion_base;
|
||||||
}
|
}
|
||||||
if (message.dispersion_traverse !== 0) {
|
if (message.dispersion_traverse !== 0) {
|
||||||
obj.dispersionTraverse = message.dispersion_traverse;
|
obj.dispersion_traverse = message.dispersion_traverse;
|
||||||
}
|
}
|
||||||
if (message.dispersion_shot !== 0) {
|
if (message.dispersion_shot !== 0) {
|
||||||
obj.dispersionShot = message.dispersion_shot;
|
obj.dispersion_shot = message.dispersion_shot;
|
||||||
}
|
}
|
||||||
if (message.dispersion_damaged !== 0) {
|
if (message.dispersion_damaged !== 0) {
|
||||||
obj.dispersionDamaged = message.dispersion_damaged;
|
obj.dispersion_damaged = message.dispersion_damaged;
|
||||||
}
|
}
|
||||||
if (message.unlocks?.length) {
|
if (message.unlocks?.length) {
|
||||||
obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e));
|
obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e));
|
||||||
}
|
}
|
||||||
if (message.shell_capacity !== 0) {
|
if (message.shell_capacity !== 0) {
|
||||||
obj.shellCapacity = Math.round(message.shell_capacity);
|
obj.shell_capacity = Math.round(message.shell_capacity);
|
||||||
}
|
}
|
||||||
if (message.assault_ranges !== undefined) {
|
if (message.assault_ranges !== undefined) {
|
||||||
obj.assaultRanges = AssaultRanges.toJSON(message.assault_ranges);
|
obj.assault_ranges = AssaultRanges.toJSON(message.assault_ranges);
|
||||||
}
|
}
|
||||||
if (message.burst !== undefined) {
|
if (message.burst !== undefined) {
|
||||||
obj.burst = Burst.toJSON(message.burst);
|
obj.burst = Burst.toJSON(message.burst);
|
||||||
@@ -3080,34 +2921,22 @@ export const GunDefinitionAutoLoader: MessageFns<GunDefinitionAutoLoader> = {
|
|||||||
|
|
||||||
fromJSON(object: any): GunDefinitionAutoLoader {
|
fromJSON(object: any): GunDefinitionAutoLoader {
|
||||||
return {
|
return {
|
||||||
clip_reload: isSet(object.clipReload)
|
clip_reload: isSet(object.clip_reload) ? globalThis.Number(object.clip_reload) : 0,
|
||||||
? globalThis.Number(object.clipReload)
|
intra_clip: isSet(object.intra_clip) ? globalThis.Number(object.intra_clip) : 0,
|
||||||
: isSet(object.clip_reload)
|
shell_count: isSet(object.shell_count) ? globalThis.Number(object.shell_count) : 0,
|
||||||
? globalThis.Number(object.clip_reload)
|
|
||||||
: 0,
|
|
||||||
intra_clip: isSet(object.intraClip)
|
|
||||||
? globalThis.Number(object.intraClip)
|
|
||||||
: isSet(object.intra_clip)
|
|
||||||
? globalThis.Number(object.intra_clip)
|
|
||||||
: 0,
|
|
||||||
shell_count: isSet(object.shellCount)
|
|
||||||
? globalThis.Number(object.shellCount)
|
|
||||||
: isSet(object.shell_count)
|
|
||||||
? globalThis.Number(object.shell_count)
|
|
||||||
: 0,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GunDefinitionAutoLoader): unknown {
|
toJSON(message: GunDefinitionAutoLoader): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.clip_reload !== 0) {
|
if (message.clip_reload !== 0) {
|
||||||
obj.clipReload = message.clip_reload;
|
obj.clip_reload = message.clip_reload;
|
||||||
}
|
}
|
||||||
if (message.intra_clip !== 0) {
|
if (message.intra_clip !== 0) {
|
||||||
obj.intraClip = message.intra_clip;
|
obj.intra_clip = message.intra_clip;
|
||||||
}
|
}
|
||||||
if (message.shell_count !== 0) {
|
if (message.shell_count !== 0) {
|
||||||
obj.shellCount = message.shell_count;
|
obj.shell_count = message.shell_count;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -3270,34 +3099,24 @@ export const GunDefinitionAutoReloader: MessageFns<GunDefinitionAutoReloader> =
|
|||||||
|
|
||||||
fromJSON(object: any): GunDefinitionAutoReloader {
|
fromJSON(object: any): GunDefinitionAutoReloader {
|
||||||
return {
|
return {
|
||||||
shell_reloads: globalThis.Array.isArray(object?.shellReloads)
|
shell_reloads: globalThis.Array.isArray(object?.shell_reloads)
|
||||||
? object.shellReloads.map((e: any) => globalThis.Number(e))
|
|
||||||
: globalThis.Array.isArray(object?.shell_reloads)
|
|
||||||
? object.shell_reloads.map((e: any) => globalThis.Number(e))
|
? object.shell_reloads.map((e: any) => globalThis.Number(e))
|
||||||
: [],
|
: [],
|
||||||
intra_clip: isSet(object.intraClip)
|
intra_clip: isSet(object.intra_clip) ? globalThis.Number(object.intra_clip) : 0,
|
||||||
? globalThis.Number(object.intraClip)
|
shell_count: isSet(object.shell_count) ? globalThis.Number(object.shell_count) : 0,
|
||||||
: isSet(object.intra_clip)
|
|
||||||
? globalThis.Number(object.intra_clip)
|
|
||||||
: 0,
|
|
||||||
shell_count: isSet(object.shellCount)
|
|
||||||
? globalThis.Number(object.shellCount)
|
|
||||||
: isSet(object.shell_count)
|
|
||||||
? globalThis.Number(object.shell_count)
|
|
||||||
: 0,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GunDefinitionAutoReloader): unknown {
|
toJSON(message: GunDefinitionAutoReloader): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.shell_reloads?.length) {
|
if (message.shell_reloads?.length) {
|
||||||
obj.shellReloads = message.shell_reloads;
|
obj.shell_reloads = message.shell_reloads;
|
||||||
}
|
}
|
||||||
if (message.intra_clip !== 0) {
|
if (message.intra_clip !== 0) {
|
||||||
obj.intraClip = message.intra_clip;
|
obj.intra_clip = message.intra_clip;
|
||||||
}
|
}
|
||||||
if (message.shell_count !== 0) {
|
if (message.shell_count !== 0) {
|
||||||
obj.shellCount = message.shell_count;
|
obj.shell_count = message.shell_count;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -3663,27 +3482,15 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
|
|||||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
velocity: isSet(object.velocity) ? globalThis.Number(object.velocity) : 0,
|
velocity: isSet(object.velocity) ? globalThis.Number(object.velocity) : 0,
|
||||||
armor_damage: isSet(object.armorDamage)
|
armor_damage: isSet(object.armor_damage) ? globalThis.Number(object.armor_damage) : 0,
|
||||||
? globalThis.Number(object.armorDamage)
|
module_damage: isSet(object.module_damage) ? globalThis.Number(object.module_damage) : 0,
|
||||||
: isSet(object.armor_damage)
|
|
||||||
? globalThis.Number(object.armor_damage)
|
|
||||||
: 0,
|
|
||||||
module_damage: isSet(object.moduleDamage)
|
|
||||||
? globalThis.Number(object.moduleDamage)
|
|
||||||
: isSet(object.module_damage)
|
|
||||||
? globalThis.Number(object.module_damage)
|
|
||||||
: 0,
|
|
||||||
caliber: isSet(object.caliber) ? globalThis.Number(object.caliber) : 0,
|
caliber: isSet(object.caliber) ? globalThis.Number(object.caliber) : 0,
|
||||||
icon: isSet(object.icon) ? globalThis.String(object.icon) : "",
|
icon: isSet(object.icon) ? globalThis.String(object.icon) : "",
|
||||||
penetration: isSet(object.penetration) ? ShellPenetration.fromJSON(object.penetration) : undefined,
|
penetration: isSet(object.penetration) ? ShellPenetration.fromJSON(object.penetration) : undefined,
|
||||||
type: isSet(object.type) ? shellTypeFromJSON(object.type) : 0,
|
type: isSet(object.type) ? shellTypeFromJSON(object.type) : 0,
|
||||||
normalization: isSet(object.normalization) ? globalThis.Number(object.normalization) : 0,
|
normalization: isSet(object.normalization) ? globalThis.Number(object.normalization) : 0,
|
||||||
ricochet: isSet(object.ricochet) ? globalThis.Number(object.ricochet) : 0,
|
ricochet: isSet(object.ricochet) ? globalThis.Number(object.ricochet) : 0,
|
||||||
explosion_radius: isSet(object.explosionRadius)
|
explosion_radius: isSet(object.explosion_radius) ? globalThis.Number(object.explosion_radius) : 0,
|
||||||
? globalThis.Number(object.explosionRadius)
|
|
||||||
: isSet(object.explosion_radius)
|
|
||||||
? globalThis.Number(object.explosion_radius)
|
|
||||||
: 0,
|
|
||||||
range: isSet(object.range) ? globalThis.Number(object.range) : 0,
|
range: isSet(object.range) ? globalThis.Number(object.range) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -3700,10 +3507,10 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
|
|||||||
obj.velocity = Math.round(message.velocity);
|
obj.velocity = Math.round(message.velocity);
|
||||||
}
|
}
|
||||||
if (message.armor_damage !== 0) {
|
if (message.armor_damage !== 0) {
|
||||||
obj.armorDamage = Math.round(message.armor_damage);
|
obj.armor_damage = Math.round(message.armor_damage);
|
||||||
}
|
}
|
||||||
if (message.module_damage !== 0) {
|
if (message.module_damage !== 0) {
|
||||||
obj.moduleDamage = Math.round(message.module_damage);
|
obj.module_damage = Math.round(message.module_damage);
|
||||||
}
|
}
|
||||||
if (message.caliber !== 0) {
|
if (message.caliber !== 0) {
|
||||||
obj.caliber = message.caliber;
|
obj.caliber = message.caliber;
|
||||||
@@ -3724,7 +3531,7 @@ export const ShellDefinition: MessageFns<ShellDefinition> = {
|
|||||||
obj.ricochet = message.ricochet;
|
obj.ricochet = message.ricochet;
|
||||||
}
|
}
|
||||||
if (message.explosion_radius !== undefined && message.explosion_radius !== 0) {
|
if (message.explosion_radius !== undefined && message.explosion_radius !== 0) {
|
||||||
obj.explosionRadius = message.explosion_radius;
|
obj.explosion_radius = message.explosion_radius;
|
||||||
}
|
}
|
||||||
if (message.range !== 0) {
|
if (message.range !== 0) {
|
||||||
obj.range = Math.round(message.range);
|
obj.range = Math.round(message.range);
|
||||||
|
|||||||
@@ -45,14 +45,13 @@ const consumableDefinitions = await api.consumableDefinitions();
|
|||||||
const provisionDefinitions = await api.provisionDefinitions();
|
const provisionDefinitions = await api.provisionDefinitions();
|
||||||
const tankDefinitions = await api.tankDefinitions();
|
const tankDefinitions = await api.tankDefinitions();
|
||||||
|
|
||||||
const gameModeRoleSets: Record<number, Set<number>> = {};
|
const gameModeRoleSets: Record<string, Set<number>> = {};
|
||||||
|
|
||||||
for (const tankIdString in tankDefinitions.tanks) {
|
for (const tankIdString in tankDefinitions.tanks) {
|
||||||
const gameMode = tankDefinitions.tanks[tankIdString];
|
const gameMode = tankDefinitions.tanks[tankIdString];
|
||||||
|
|
||||||
for (const gameModeIdString in gameMode.roles) {
|
for (const gameModeId in gameMode.roles) {
|
||||||
const role = gameMode.roles[gameModeIdString];
|
const role = gameMode.roles[gameModeId];
|
||||||
const gameModeId = Number(gameModeIdString);
|
|
||||||
|
|
||||||
if (gameModeId in gameModeRoleSets) {
|
if (gameModeId in gameModeRoleSets) {
|
||||||
gameModeRoleSets[gameModeId].add(role);
|
gameModeRoleSets[gameModeId].add(role);
|
||||||
@@ -63,7 +62,7 @@ for (const tankIdString in tankDefinitions.tanks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gameModeRoles: {
|
const gameModeRoles: {
|
||||||
gameModeId: number;
|
gameModeId: string;
|
||||||
consumables: number[];
|
consumables: number[];
|
||||||
provisions: number[];
|
provisions: number[];
|
||||||
}[] = [];
|
}[] = [];
|
||||||
@@ -72,8 +71,7 @@ const allGameModeConsumables = new Set<number>();
|
|||||||
const allGameModeProvisions = new Set<number>();
|
const allGameModeProvisions = new Set<number>();
|
||||||
|
|
||||||
for (const gameModeIdString in gameModeRoleSets) {
|
for (const gameModeIdString in gameModeRoleSets) {
|
||||||
const gameModeId = Number(gameModeIdString);
|
const roles = gameModeRoleSets[gameModeIdString];
|
||||||
const roles = gameModeRoleSets[gameModeId];
|
|
||||||
const consumables = new Set<number>();
|
const consumables = new Set<number>();
|
||||||
const provisions = new Set<number>();
|
const provisions = new Set<number>();
|
||||||
|
|
||||||
@@ -116,7 +114,7 @@ for (const gameModeIdString in gameModeRoleSets) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gameModeRoles.push({
|
gameModeRoles.push({
|
||||||
gameModeId: gameModeId,
|
gameModeId: gameModeIdString,
|
||||||
consumables: Array.from(consumables.values()),
|
consumables: Array.from(consumables.values()),
|
||||||
provisions: Array.from(provisions.values()),
|
provisions: Array.from(provisions.values()),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ export function GameModeSection() {
|
|||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Flex justify="center" gap="4" wrap="wrap" px="4">
|
<Flex justify="center" gap="4" wrap="wrap" px="4">
|
||||||
{roles.map(([key, value]) => {
|
{roles.map(([id, value]) => {
|
||||||
const id = Number(key);
|
|
||||||
const gameMode = gameDefinitions.gameModes[id];
|
const gameMode = gameDefinitions.gameModes[id];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
const bannerMatches: { name: string; path: string }[] = [];
|
const bannerMatches: { name: string; path: string }[] = [];
|
||||||
|
|
||||||
for (const match of gameTypeSelectorStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
for (const match of gameTypeSelectorStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
/eGameMode\.([a-zA-Z]+) -> "~res:([^"]+)"/g,
|
/eGameMode\.(\w+) -> "~res:([^"]+)"/g,
|
||||||
)) {
|
)) {
|
||||||
bannerMatches.push({ name: match[1], path: match[2] });
|
bannerMatches.push({ name: match[1], path: match[2] });
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const match of squadBattleTypeStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
for (const match of squadBattleTypeStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
/"(\d+)" -> "battleType\/([a-zA-Z]+)"/g,
|
/eGameMode\.(\w+) -> "battleType\/([a-zA-Z]+)"/g,
|
||||||
)) {
|
)) {
|
||||||
const id = Number(match[1]);
|
const id = match[1];
|
||||||
const name = match[2];
|
const name = match[2];
|
||||||
let path = bannerMatches.find(
|
let path = bannerMatches.find(
|
||||||
(bannerMatch) => bannerMatch.name.toLowerCase() === name.toLowerCase(),
|
(bannerMatch) => bannerMatch.name.toLowerCase() === name.toLowerCase(),
|
||||||
|
|||||||
Reference in new issue
Block a user