mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: equalizer protos
This commit is contained in:
1 parent
ec6ac128f2
commit
e36823c159
5 files changed
+1246
-831
No files matched your search
@@ -1,16 +1,16 @@
|
||||
// @ts-nocheck
|
||||
export * from './average_definitions.ts';
|
||||
export * from './camouflage_definitions.ts';
|
||||
export * from './consumable_definitions.ts';
|
||||
export * from './equipment_definitions.ts';
|
||||
export * from './gallery.ts';
|
||||
export * from './game_definitions.ts';
|
||||
export * from './i18n.ts';
|
||||
export * from './map_definitions.ts';
|
||||
export * from './model_definitions.ts';
|
||||
export * from './popular_tanks.ts';
|
||||
export * from './provision_definitions.ts';
|
||||
export * from './rating_leaderboard.ts';
|
||||
export * from './reviews.ts';
|
||||
export * from './skill_definitions.ts';
|
||||
export * from './tank_definitions.ts';
|
||||
export * from "./average_definitions.ts";
|
||||
export * from "./camouflage_definitions.ts";
|
||||
export * from "./consumable_definitions.ts";
|
||||
export * from "./equipment_definitions.ts";
|
||||
export * from "./gallery.ts";
|
||||
export * from "./game_definitions.ts";
|
||||
export * from "./i18n.ts";
|
||||
export * from "./map_definitions.ts";
|
||||
export * from "./model_definitions.ts";
|
||||
export * from "./popular_tanks.ts";
|
||||
export * from "./provision_definitions.ts";
|
||||
export * from "./rating_leaderboard.ts";
|
||||
export * from "./reviews.ts";
|
||||
export * from "./skill_definitions.ts";
|
||||
export * from "./tank_definitions.ts";
|
||||
File diff suppressed because it is too large.
Load diff
@@ -40,6 +40,15 @@ message TankDefinition {
|
||||
required string equipment_preset = 30;
|
||||
required uint32 weight = 31;
|
||||
required string dev_name = 32;
|
||||
required Equalizer equalizer = 33;
|
||||
}
|
||||
|
||||
message Equalizer {
|
||||
required float health = 1;
|
||||
required float penetration = 2;
|
||||
required float module_health = 3;
|
||||
required float damage = 4;
|
||||
required float armor = 5;
|
||||
}
|
||||
|
||||
message ResearchCost {
|
||||
|
||||
@@ -291,6 +291,7 @@ export interface TankDefinition {
|
||||
equipment_preset: string;
|
||||
weight: number;
|
||||
dev_name: string;
|
||||
equalizer: Equalizer | undefined;
|
||||
}
|
||||
|
||||
export interface TankDefinition_RolesEntry {
|
||||
@@ -298,6 +299,14 @@ export interface TankDefinition_RolesEntry {
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface Equalizer {
|
||||
health: number;
|
||||
penetration: number;
|
||||
module_health: number;
|
||||
damage: number;
|
||||
armor: number;
|
||||
}
|
||||
|
||||
export interface ResearchCost {
|
||||
research_cost_type?:
|
||||
| { $case: "xp"; value: number }
|
||||
@@ -644,6 +653,7 @@ function createBaseTankDefinition(): TankDefinition {
|
||||
equipment_preset: "",
|
||||
weight: 0,
|
||||
dev_name: "",
|
||||
equalizer: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -742,6 +752,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
if (message.dev_name !== "") {
|
||||
writer.uint32(258).string(message.dev_name);
|
||||
}
|
||||
if (message.equalizer !== undefined) {
|
||||
Equalizer.encode(message.equalizer, writer.uint32(266).fork()).join();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
@@ -1033,6 +1046,14 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
message.dev_name = reader.string();
|
||||
continue;
|
||||
}
|
||||
case 33: {
|
||||
if (tag !== 266) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.equalizer = Equalizer.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
@@ -1141,6 +1162,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
: isSet(object.dev_name)
|
||||
? globalThis.String(object.dev_name)
|
||||
: "",
|
||||
equalizer: isSet(object.equalizer) ? Equalizer.fromJSON(object.equalizer) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -1245,6 +1267,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
if (message.dev_name !== "") {
|
||||
obj.devName = message.dev_name;
|
||||
}
|
||||
if (message.equalizer !== undefined) {
|
||||
obj.equalizer = Equalizer.toJSON(message.equalizer);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
@@ -1298,6 +1323,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
message.equipment_preset = object.equipment_preset ?? "";
|
||||
message.weight = object.weight ?? 0;
|
||||
message.dev_name = object.dev_name ?? "";
|
||||
message.equalizer = (object.equalizer !== undefined && object.equalizer !== null)
|
||||
? Equalizer.fromPartial(object.equalizer)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
@@ -1378,6 +1406,134 @@ export const TankDefinition_RolesEntry: MessageFns<TankDefinition_RolesEntry> =
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEqualizer(): Equalizer {
|
||||
return { health: 0, penetration: 0, module_health: 0, damage: 0, armor: 0 };
|
||||
}
|
||||
|
||||
export const Equalizer: MessageFns<Equalizer> = {
|
||||
encode(message: Equalizer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||
if (message.health !== 0) {
|
||||
writer.uint32(13).float(message.health);
|
||||
}
|
||||
if (message.penetration !== 0) {
|
||||
writer.uint32(21).float(message.penetration);
|
||||
}
|
||||
if (message.module_health !== 0) {
|
||||
writer.uint32(29).float(message.module_health);
|
||||
}
|
||||
if (message.damage !== 0) {
|
||||
writer.uint32(37).float(message.damage);
|
||||
}
|
||||
if (message.armor !== 0) {
|
||||
writer.uint32(45).float(message.armor);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: BinaryReader | Uint8Array, length?: number): Equalizer {
|
||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||
const end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEqualizer();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
if (tag !== 13) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.health = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 2: {
|
||||
if (tag !== 21) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.penetration = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 3: {
|
||||
if (tag !== 29) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.module_health = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 4: {
|
||||
if (tag !== 37) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.damage = reader.float();
|
||||
continue;
|
||||
}
|
||||
case 5: {
|
||||
if (tag !== 45) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.armor = reader.float();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skip(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Equalizer {
|
||||
return {
|
||||
health: isSet(object.health) ? globalThis.Number(object.health) : 0,
|
||||
penetration: isSet(object.penetration) ? globalThis.Number(object.penetration) : 0,
|
||||
module_health: isSet(object.moduleHealth)
|
||||
? globalThis.Number(object.moduleHealth)
|
||||
: isSet(object.module_health)
|
||||
? globalThis.Number(object.module_health)
|
||||
: 0,
|
||||
damage: isSet(object.damage) ? globalThis.Number(object.damage) : 0,
|
||||
armor: isSet(object.armor) ? globalThis.Number(object.armor) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Equalizer): unknown {
|
||||
const obj: any = {};
|
||||
if (message.health !== 0) {
|
||||
obj.health = message.health;
|
||||
}
|
||||
if (message.penetration !== 0) {
|
||||
obj.penetration = message.penetration;
|
||||
}
|
||||
if (message.module_health !== 0) {
|
||||
obj.moduleHealth = message.module_health;
|
||||
}
|
||||
if (message.damage !== 0) {
|
||||
obj.damage = message.damage;
|
||||
}
|
||||
if (message.armor !== 0) {
|
||||
obj.armor = message.armor;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<Equalizer>, I>>(base?: I): Equalizer {
|
||||
return Equalizer.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<Equalizer>, I>>(object: I): Equalizer {
|
||||
const message = createBaseEqualizer();
|
||||
message.health = object.health ?? 0;
|
||||
message.penetration = object.penetration ?? 0;
|
||||
message.module_health = object.module_health ?? 0;
|
||||
message.damage = object.damage ?? 0;
|
||||
message.armor = object.armor ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseResearchCost(): ResearchCost {
|
||||
return { research_cost_type: undefined };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user