feat: proper assembly

This commit is contained in:
tresabhi committed 2025-03-29 21:15:55 -05:00
1 parent 838ce7f35d
commit cb03a86cce
13 files changed
+208 -35

No files matched your search

+1
View File
@@ -12,6 +12,7 @@
"APAC", "APAC",
"apcr", "apcr",
"applypatches", "applypatches",
"arrayfy",
"artefacts", "artefacts",
"astrojs", "astrojs",
"atgm", "atgm",
+2
View File
@@ -13,7 +13,9 @@ message Tank {
} }
message Turret { message Turret {
required string id = 1;
} }
message Gun { message Gun {
required string id = 1;
} }
+44 -12
View File
@@ -29,9 +29,11 @@ export interface Tank_GunsEntry {
} }
export interface Turret { export interface Turret {
id: string;
} }
export interface Gun { export interface Gun {
id: string;
} }
function createBaseTank(): Tank { function createBaseTank(): Tank {
@@ -353,11 +355,14 @@ export const Tank_GunsEntry: MessageFns<Tank_GunsEntry> = {
}; };
function createBaseTurret(): Turret { function createBaseTurret(): Turret {
return {}; return { id: "" };
} }
export const Turret: MessageFns<Turret> = { export const Turret: MessageFns<Turret> = {
encode(_: Turret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: Turret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer; return writer;
}, },
@@ -368,6 +373,14 @@ export const Turret: MessageFns<Turret> = {
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@@ -377,30 +390,37 @@ export const Turret: MessageFns<Turret> = {
return message; return message;
}, },
fromJSON(_: any): Turret { fromJSON(object: any): Turret {
return {}; return { id: globalThis.String(assertSet("Turret.id", object.id)) };
}, },
toJSON(_: Turret): unknown { toJSON(message: Turret): unknown {
const obj: any = {}; const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<Turret>, I>>(base?: I): Turret { create<I extends Exact<DeepPartial<Turret>, I>>(base?: I): Turret {
return Turret.fromPartial(base ?? ({} as any)); return Turret.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<Turret>, I>>(_: I): Turret { fromPartial<I extends Exact<DeepPartial<Turret>, I>>(object: I): Turret {
const message = createBaseTurret(); const message = createBaseTurret();
message.id = object.id ?? "";
return message; return message;
}, },
}; };
function createBaseGun(): Gun { function createBaseGun(): Gun {
return {}; return { id: "" };
} }
export const Gun: MessageFns<Gun> = { export const Gun: MessageFns<Gun> = {
encode(_: Gun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: Gun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer; return writer;
}, },
@@ -411,6 +431,14 @@ export const Gun: MessageFns<Gun> = {
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@@ -420,20 +448,24 @@ export const Gun: MessageFns<Gun> = {
return message; return message;
}, },
fromJSON(_: any): Gun { fromJSON(object: any): Gun {
return {}; return { id: globalThis.String(assertSet("Gun.id", object.id)) };
}, },
toJSON(_: Gun): unknown { toJSON(message: Gun): unknown {
const obj: any = {}; const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj; return obj;
}, },
create<I extends Exact<DeepPartial<Gun>, I>>(base?: I): Gun { create<I extends Exact<DeepPartial<Gun>, I>>(base?: I): Gun {
return Gun.fromPartial(base ?? ({} as any)); return Gun.fromPartial(base ?? ({} as any));
}, },
fromPartial<I extends Exact<DeepPartial<Gun>, I>>(_: I): Gun { fromPartial<I extends Exact<DeepPartial<Gun>, I>>(object: I): Gun {
const message = createBaseGun(); const message = createBaseGun();
message.id = object.id ?? "";
return message; return message;
}, },
}; };
@@ -1,4 +1,7 @@
import { memo } from 'react'; import { memo } from 'react';
import { arrayfy } from '../../../core/three/arrayfy';
import { Duel } from '../../../stores/duel';
import { TankopediaEphemeral } from '../../../stores/tankopediaEphemeral';
import { StaticArmorSceneComponent } from './StaticArmorSceneComponent'; import { StaticArmorSceneComponent } from './StaticArmorSceneComponent';
export interface ThicknessRange { export interface ThicknessRange {
@@ -6,17 +9,24 @@ export interface ThicknessRange {
} }
export const StaticArmor = memo(() => { export const StaticArmor = memo(() => {
const tank = Duel.use((state) => state.protagonist);
const model = TankopediaEphemeral.use((state) => state.model);
const turret = Duel.use((state) => state.protagonist.turret);
const gun = Duel.use((state) => state.protagonist.gun);
const turretTranslation = arrayfy(model.modules[turret.id].translation);
const gunTranslation = arrayfy(model.modules[gun.id].translation);
return ( return (
<group> <group>
<StaticArmorSceneComponent group="hull" /> <StaticArmorSceneComponent group="hull" />
<StaticArmorSceneComponent group="chassis" /> <StaticArmorSceneComponent group="chassis" />
<group position={[65.92709 / 100, 155.5313 / 100, 0.022151405 / 100]}> <group position={turretTranslation}>
<StaticArmorSceneComponent group="turret_01" /> <StaticArmorSceneComponent group={turret.id} />
</group> </group>
<group position={[194.92838 / 100, 190.19179 / 100, 0.06545235 / 100]}> <group position={gunTranslation}>
<StaticArmorSceneComponent group="gun_01" /> <StaticArmorSceneComponent group={gun.id} />
</group> </group>
</group> </group>
); );
@@ -44,6 +44,12 @@ export function StaticArmorSceneComponent({
const armorName = mesh.material.name; const armorName = mesh.material.name;
const armorPlate = groupArmor.armors[armorName]; const armorPlate = groupArmor.armors[armorName];
if (armorPlate === undefined) {
console.warn(`Missing armor: ${armorName}`);
return null;
}
const x = armorPlate.thickness / thicknessRange; const x = armorPlate.thickness / thicknessRange;
const xClamped = clamp(x, 0, 1); const xClamped = clamp(x, 0, 1);
const material = new MeshStandardMaterial(); const material = new MeshStandardMaterial();
@@ -5,8 +5,8 @@ export function tankToDuelMember(
tank: Tank, tank: Tank,
// provisionDefinitions: ProvisionDefinitions, // provisionDefinitions: ProvisionDefinitions,
) { ) {
// const turret = tank.turrets.at(-1)!; const turret = Object.values(tank.turrets).at(-1)!;
// const gun = turret.guns.at(-1)!; const gun = Object.values(tank.guns).at(-1)!;
return { return {
// camouflage: true, // camouflage: true,
@@ -15,12 +15,12 @@ export function tankToDuelMember(
// cooldownBooster: 0, // cooldownBooster: 0,
// provisions: createDefaultProvisions(tank, gun, provisionDefinitions), // provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
// engine: tank.engines.at(-1)!, // engine: tank.engines.at(-1)!,
// gun, gun,
// shell: tank.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0], // shell: tank.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0],
tank, tank,
// track: tank.tracks.at(-1)!, // track: tank.tracks.at(-1)!,
// yaw: 0, // yaw: 0,
// pitch: 0, // pitch: 0,
// turret, turret,
} satisfies DuelMember; } satisfies DuelMember;
} }
@@ -0,0 +1,5 @@
import type { Vector3 } from '@blitzkit/core';
export function arrayfy(vector: Vector3) {
return [vector.x, vector.y, vector.z] as const;
}
@@ -1,4 +1,4 @@
import { Tank, TankArmor } from '@blitzkit/core'; import { Tank, TankArmor, TankModel } from '@blitzkit/core';
import { PageWrapper } from '../../../../components/PageWrapper'; import { PageWrapper } from '../../../../components/PageWrapper';
import { HeroSection } from '../../../../components/Tankopedia/HeroSection'; import { HeroSection } from '../../../../components/Tankopedia/HeroSection';
import { import {
@@ -15,12 +15,15 @@ type PageProps = MaybeSkeletonComponentProps &
LocaleAcceptorProps & { LocaleAcceptorProps & {
tank: Tank; tank: Tank;
armor: TankArmor; armor: TankArmor;
model: TankModel;
}; };
export function Page({ tank, armor, skeleton, locale }: PageProps) { export function Page({ tank, armor, skeleton, locale, model }: PageProps) {
return ( return (
<LocaleProvider locale={locale}> <LocaleProvider locale={locale}>
<TankopediaEphemeral.Provider data={{ armor, thicknessRange: 193 }}> <TankopediaEphemeral.Provider
data={{ armor, thicknessRange: 193, model }}
>
<App.Provider> <App.Provider>
<TankopediaPersistent.Provider> <TankopediaPersistent.Provider>
<Duel.Provider <Duel.Provider
@@ -1,5 +1,5 @@
--- ---
import { fetchTank, fetchTankArmor } from '@blitzkit/core'; import { fetchTank, fetchTankArmor, fetchTankModel } from '@blitzkit/core';
import { DEFAULT_LOCALE } from '@blitzkit/i18n'; import { DEFAULT_LOCALE } from '@blitzkit/i18n';
import type { GetStaticPaths } from 'astro'; import type { GetStaticPaths } from 'astro';
import { awaitableTanksFull } from '../../../../core/awaitables/tanksFull'; import { awaitableTanksFull } from '../../../../core/awaitables/tanksFull';
@@ -25,6 +25,7 @@ const locale = Astro.params.locale ?? DEFAULT_LOCALE;
const { id } = Astro.props; const { id } = Astro.props;
const tank = await fetchTank(id); const tank = await fetchTank(id);
const armor = await fetchTankArmor(id); const armor = await fetchTankArmor(id);
const model = await fetchTankModel(id);
// const strings = getStrings(locale); // const strings = getStrings(locale);
// const tankDefinitions = await fetchTankDefinitions(); // const tankDefinitions = await fetchTankDefinitions();
@@ -94,7 +95,7 @@ const armor = await fetchTankArmor(id);
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
<meta name="twitter:image:src" content={icon} /> --> <meta name="twitter:image:src" content={icon} /> -->
<BaseLayout> <BaseLayout>
<Page {tank} {armor} {locale} client:only="react"> <Page {model} {tank} {armor} {locale} client:only="react">
<Page {tank} {armor} {locale} skeleton slot="fallback" /> <Page {model} {tank} {armor} {locale} skeleton slot="fallback" />
</Page> </Page>
</BaseLayout> </BaseLayout>
+3 -3
View File
@@ -1,4 +1,4 @@
import { Tank } from '@blitzkit/core'; import { Gun, Tank, Turret } from '@blitzkit/core';
import { create } from 'zustand'; import { create } from 'zustand';
import { subscribeWithSelector } from 'zustand/middleware'; import { subscribeWithSelector } from 'zustand/middleware';
import { tankToDuelMember } from '../../core/blitzkit/tankToDuelMember'; import { tankToDuelMember } from '../../core/blitzkit/tankToDuelMember';
@@ -19,8 +19,8 @@ export type EquipmentMatrix = [
export interface DuelMember { export interface DuelMember {
tank: Tank; tank: Tank;
// engine: EngineDefinition; // engine: EngineDefinition;
// turret: TurretDefinition; turret: Turret;
// gun: GunDefinition; gun: Gun;
// shell: ShellDefinition; // shell: ShellDefinition;
// track: TrackDefinition; // track: TrackDefinition;
// equipmentMatrix: EquipmentMatrix; // equipmentMatrix: EquipmentMatrix;
@@ -2,6 +2,7 @@ import {
createDefaultSkills, createDefaultSkills,
ShellDefinition, ShellDefinition,
TankArmor, TankArmor,
TankModel,
} from '@blitzkit/core'; } from '@blitzkit/core';
import type { Vector3 } from 'three'; import type { Vector3 } from 'three';
import { create } from 'zustand'; import { create } from 'zustand';
@@ -103,6 +104,7 @@ interface TankopediaEphemeral {
relativeAgainst: TankopediaRelativeAgainst; relativeAgainst: TankopediaRelativeAgainst;
controlsEnabled: boolean; controlsEnabled: boolean;
armor: TankArmor; armor: TankArmor;
model: TankModel;
editStatic: boolean; editStatic: boolean;
highlightArmor?: { highlightArmor?: {
editingPlate: boolean; editingPlate: boolean;
@@ -126,7 +128,15 @@ interface TankopediaEphemeral {
const skillDefinitions = await awaitableSkillDefinitions; const skillDefinitions = await awaitableSkillDefinitions;
export const TankopediaEphemeral = createContextualStore( export const TankopediaEphemeral = createContextualStore(
({ armor, thicknessRange }: { armor: TankArmor; thicknessRange: number }) => { ({
armor,
thicknessRange,
model,
}: {
armor: TankArmor;
thicknessRange: number;
model: TankModel;
}) => {
return create<TankopediaEphemeral>()( return create<TankopediaEphemeral>()(
subscribeWithSelector<TankopediaEphemeral>(() => ({ subscribeWithSelector<TankopediaEphemeral>(() => ({
thicknessRange, thicknessRange,
@@ -135,6 +145,7 @@ export const TankopediaEphemeral = createContextualStore(
editStatic: false, editStatic: false,
skills: createDefaultSkills(skillDefinitions), skills: createDefaultSkills(skillDefinitions),
armor, armor,
model,
controlsEnabled: true, controlsEnabled: true,
xpMultiplier: 1, xpMultiplier: 1,
display: TankopediaDisplay.StaticArmor, display: TankopediaDisplay.StaticArmor,
+2 -2
View File
@@ -330,14 +330,14 @@ namespace BlitzKit.CLI.Functions
{ {
case "DT_Turrets": case "DT_Turrets":
{ {
Turret turret = new(); Turret turret = new() { Id = moduleName };
tank.Turrets[moduleName] = turret; tank.Turrets[moduleName] = turret;
break; break;
} }
case "DT_Guns": case "DT_Guns":
{ {
Gun gun = new(); Gun gun = new() { Id = moduleName };
tank.Guns[moduleName] = gun; tank.Guns[moduleName] = gun;
break; break;
} }
+105 -3
View File
@@ -32,13 +32,13 @@ namespace Blitzkit {
"ay5HdW5zRW50cnkaQAoMVHVycmV0c0VudHJ5EgsKA2tleRgBIAEoCRIfCgV2", "ay5HdW5zRW50cnkaQAoMVHVycmV0c0VudHJ5EgsKA2tleRgBIAEoCRIfCgV2",
"YWx1ZRgCIAEoCzIQLmJsaXR6a2l0LlR1cnJldDoCOAEaOgoJR3Vuc0VudHJ5", "YWx1ZRgCIAEoCzIQLmJsaXR6a2l0LlR1cnJldDoCOAEaOgoJR3Vuc0VudHJ5",
"EgsKA2tleRgBIAEoCRIcCgV2YWx1ZRgCIAEoCzINLmJsaXR6a2l0Lkd1bjoC", "EgsKA2tleRgBIAEoCRIcCgV2YWx1ZRgCIAEoCzINLmJsaXR6a2l0Lkd1bjoC",
"OAEiCAoGVHVycmV0IgUKA0d1bg==")); "OAEiFAoGVHVycmV0EgoKAmlkGAEgAigJIhEKA0d1bhIKCgJpZBgBIAIoCQ=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Blitzkit.UtilsReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Blitzkit.UtilsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tank), global::Blitzkit.Tank.Parser, new[]{ "Id", "Slug", "Name", "Turrets", "Guns" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Tank), global::Blitzkit.Tank.Parser, new[]{ "Id", "Slug", "Name", "Turrets", "Guns" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Turret), global::Blitzkit.Turret.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Turret), global::Blitzkit.Turret.Parser, new[]{ "Id" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Gun), global::Blitzkit.Gun.Parser, null, null, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Blitzkit.Gun), global::Blitzkit.Gun.Parser, new[]{ "Id" }, null, null, null, null)
})); }));
} }
#endregion #endregion
@@ -441,6 +441,7 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Turret(Turret other) : this() { public Turret(Turret other) : this() {
id_ = other.id_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@@ -450,6 +451,32 @@ namespace Blitzkit {
return new Turret(this); return new Turret(this);
} }
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 1;
private readonly static string IdDefaultValue = "";
private string id_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Id {
get { return id_ ?? IdDefaultValue; }
set {
id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "id" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool HasId {
get { return id_ != null; }
}
/// <summary>Clears the value of the "id" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearId() {
id_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) { public override bool Equals(object other) {
@@ -465,6 +492,7 @@ namespace Blitzkit {
if (ReferenceEquals(other, this)) { if (ReferenceEquals(other, this)) {
return true; return true;
} }
if (Id != other.Id) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@@ -472,6 +500,7 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (HasId) hash ^= Id.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@@ -490,6 +519,10 @@ namespace Blitzkit {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this); output.WriteRawMessage(this);
#else #else
if (HasId) {
output.WriteRawTag(10);
output.WriteString(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@@ -500,6 +533,10 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (HasId) {
output.WriteRawTag(10);
output.WriteString(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(ref output); _unknownFields.WriteTo(ref output);
} }
@@ -510,6 +547,9 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (HasId) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@@ -522,6 +562,9 @@ namespace Blitzkit {
if (other == null) { if (other == null) {
return; return;
} }
if (other.HasId) {
Id = other.Id;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@@ -541,6 +584,10 @@ namespace Blitzkit {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break; break;
case 10: {
Id = input.ReadString();
break;
}
} }
} }
#endif #endif
@@ -560,6 +607,10 @@ namespace Blitzkit {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break; break;
case 10: {
Id = input.ReadString();
break;
}
} }
} }
} }
@@ -602,6 +653,7 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Gun(Gun other) : this() { public Gun(Gun other) : this() {
id_ = other.id_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@@ -611,6 +663,32 @@ namespace Blitzkit {
return new Gun(this); return new Gun(this);
} }
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 1;
private readonly static string IdDefaultValue = "";
private string id_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Id {
get { return id_ ?? IdDefaultValue; }
set {
id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "id" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool HasId {
get { return id_ != null; }
}
/// <summary>Clears the value of the "id" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearId() {
id_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) { public override bool Equals(object other) {
@@ -626,6 +704,7 @@ namespace Blitzkit {
if (ReferenceEquals(other, this)) { if (ReferenceEquals(other, this)) {
return true; return true;
} }
if (Id != other.Id) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@@ -633,6 +712,7 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (HasId) hash ^= Id.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@@ -651,6 +731,10 @@ namespace Blitzkit {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this); output.WriteRawMessage(this);
#else #else
if (HasId) {
output.WriteRawTag(10);
output.WriteString(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@@ -661,6 +745,10 @@ namespace Blitzkit {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (HasId) {
output.WriteRawTag(10);
output.WriteString(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(ref output); _unknownFields.WriteTo(ref output);
} }
@@ -671,6 +759,9 @@ namespace Blitzkit {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (HasId) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@@ -683,6 +774,9 @@ namespace Blitzkit {
if (other == null) { if (other == null) {
return; return;
} }
if (other.HasId) {
Id = other.Id;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@@ -702,6 +796,10 @@ namespace Blitzkit {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break; break;
case 10: {
Id = input.ReadString();
break;
}
} }
} }
#endif #endif
@@ -721,6 +819,10 @@ namespace Blitzkit {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break; break;
case 10: {
Id = input.ReadString();
break;
}
} }
} }
} }