first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata.Bases;
[Serializable, DataContract]
public class BaseAnchoredCellGhostMetadata : GhostMetadata
{
[DataMember(Order = 1)]
public NitroxInt3? AnchoredCell { get; set; }
[IgnoreConstructor]
public BaseAnchoredCellGhostMetadata()
{
// Constructor for ProtoBuf deserialization.
}
/// <remarks>Used for json deserialization</remarks>
public BaseAnchoredCellGhostMetadata(NitroxInt3? anchoredCell, NitroxInt3 targetOffset) : base(targetOffset)
{
AnchoredCell = anchoredCell;
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Bases;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata.Bases;
[Serializable, DataContract]
public class BaseAnchoredFaceGhostMetadata : GhostMetadata
{
[DataMember(Order = 1)]
public NitroxBaseFace? AnchoredFace { get; set; }
[IgnoreConstructor]
public BaseAnchoredFaceGhostMetadata()
{
// Constructor for ProtoBuf deserialization.
}
/// <remarks>Used for json deserialization</remarks>
public BaseAnchoredFaceGhostMetadata(NitroxBaseFace? anchoredFace, NitroxInt3 targetOffset) : base(targetOffset)
{
AnchoredFace = anchoredFace;
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Bases;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata.Bases;
[Serializable, DataContract]
public class BaseDeconstructableGhostMetadata : GhostMetadata
{
[DataMember(Order = 1)]
public NitroxBaseFace? ModuleFace { get; set; }
[DataMember(Order = 2)]
public string ClassId { get; set; }
[IgnoreConstructor]
public BaseDeconstructableGhostMetadata()
{
// Constructor for ProtoBuf deserialization.
}
/// <remarks>Used for json deserialization</remarks>
public BaseDeconstructableGhostMetadata(NitroxBaseFace? moduleFace, string classId, NitroxInt3 targetOffset) : base(targetOffset)
{
ModuleFace = moduleFace;
ClassId = classId;
}
public override string ToString()
{
return $"[BaseDeconstructableGhostMetadata TargetOffset: {TargetOffset}, ModuleFace: {ModuleFace}, ClassId: {ClassId}]";
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using ProtoBufNet;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata.Bases;
[Serializable, DataContract]
[ProtoInclude(50, typeof(BaseDeconstructableGhostMetadata))]
[ProtoInclude(51, typeof(BaseAnchoredFaceGhostMetadata))]
[ProtoInclude(52, typeof(BaseAnchoredCellGhostMetadata))]
public class GhostMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public NitroxInt3 TargetOffset { get; set; }
[IgnoreConstructor]
public GhostMetadata()
{
// Constructor for ProtoBuf deserialization.
}
/// <remarks>Used for json deserialization</remarks>
public GhostMetadata(NitroxInt3 targetOffset)
{
TargetOffset = targetOffset;
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class BatteryMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float Charge { get; }
[IgnoreConstructor]
protected BatteryMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public BatteryMetadata(float charge)
{
Charge = charge;
}
public override string ToString()
{
return $"[BatteryMetadata Charge: {Charge}]";
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class BeaconMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public string Label { get; }
[IgnoreConstructor]
protected BeaconMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public BeaconMetadata(string label)
{
Label = label;
}
public override string ToString()
{
return $"[BeaconMetadata Label: {Label}]";
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class ConstructorMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Deployed { get; }
[IgnoreConstructor]
protected ConstructorMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public ConstructorMetadata(bool deployed)
{
Deployed = deployed;
}
public override string ToString()
{
return $"[ConstructorMetadata Deployed: {Deployed}]";
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class CrafterMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public NitroxTechType TechType { get; }
[DataMember(Order = 2)]
public float StartTime { get; }
[DataMember(Order = 3)]
public float Duration { get; }
[IgnoreConstructor]
protected CrafterMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public CrafterMetadata(NitroxTechType techType, float startTime, float duration)
{
TechType = techType;
StartTime = startTime;
Duration = duration;
}
public override string ToString()
{
return $"[CrafterMetadata TechType: {TechType} StartTime: {StartTime} Duration: {Duration} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class CrashHomeMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float SpawnTime { get; }
[IgnoreConstructor]
protected CrashHomeMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public CrashHomeMetadata(float spawnTime)
{
SpawnTime = spawnTime;
}
public override string ToString()
{
return $"[CrashHomeMetadata SpawnTime: {SpawnTime}]";
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class CyclopsLightingMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool FloodLightsOn { get; set; }
[DataMember(Order = 2)]
public bool InternalLightsOn { get; set; }
[IgnoreConstructor]
protected CyclopsLightingMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public CyclopsLightingMetadata(bool floodLightsOn, bool internalLightsOn)
{
FloodLightsOn = floodLightsOn;
InternalLightsOn = internalLightsOn;
}
public override string ToString()
{
return $"[CyclopsLightningMetadata FloodLightsOn: {FloodLightsOn}, InternalLightsOn: {InternalLightsOn}]";
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class CyclopsMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool SilentRunningOn { get; set; }
[DataMember(Order = 2)]
public bool ShieldOn { get; set; }
[DataMember(Order = 3)]
public bool SonarOn { get; set; }
[DataMember(Order = 4)]
public bool EngineOn { get; set; }
[DataMember(Order = 5)]
public int EngineMode { get; set; }
[DataMember(Order = 6)]
public float Health { get; set; }
[DataMember(Order = 7)]
public bool IsDestroyed { get; set; }
[IgnoreConstructor]
protected CyclopsMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public CyclopsMetadata(bool silentRunningOn, bool shieldOn, bool sonarOn, bool engineOn, int engineMode, float health, bool isDestroyed)
{
SilentRunningOn = silentRunningOn;
ShieldOn = shieldOn;
SonarOn = sonarOn;
EngineOn = engineOn;
EngineMode = engineMode;
Health = health;
IsDestroyed = isDestroyed;
}
public override string ToString()
{
return $"[CyclopsMetadata SilentRunningOn: {SilentRunningOn}, ShieldOn: {ShieldOn}, SonarOn: {SonarOn}, EngineOn: {EngineOn}, EngineMode: {EngineMode}, Health: {Health}, IsDestroyed: {IsDestroyed}]";
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class EatableMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float TimeDecayStart { get; }
[IgnoreConstructor]
protected EatableMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public EatableMetadata(float timeDecayStart)
{
TimeDecayStart = timeDecayStart;
}
public override string ToString()
{
return $"[{nameof(EatableMetadata)} TimeDecayStart: {TimeDecayStart}]";
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class EggMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float TimeStartHatching { get; }
[DataMember(Order = 2)]
public float Progress { get; }
[IgnoreConstructor]
protected EggMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public EggMetadata(float timeStartHatching, float progress)
{
TimeStartHatching = timeStartHatching;
Progress = progress;
}
public override string ToString()
{
return $"[{nameof(EggMetadata)} TimeStartHatching: {TimeStartHatching}, Progress: {Progress}]";
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Runtime.Serialization;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata.Bases;
using ProtoBufNet;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
[ProtoInclude(50, typeof(KeypadMetadata))]
[ProtoInclude(51, typeof(SealedDoorMetadata))]
[ProtoInclude(52, typeof(PrecursorDoorwayMetadata))]
[ProtoInclude(53, typeof(PrecursorTeleporterMetadata))]
[ProtoInclude(54, typeof(PrecursorKeyTerminalMetadata))]
[ProtoInclude(55, typeof(PrecursorTeleporterActivationTerminalMetadata))]
[ProtoInclude(56, typeof(StarshipDoorMetadata))]
[ProtoInclude(57, typeof(WeldableWallPanelGenericMetadata))]
[ProtoInclude(58, typeof(IncubatorMetadata))]
[ProtoInclude(59, typeof(EntitySignMetadata))]
[ProtoInclude(60, typeof(ConstructorMetadata))]
[ProtoInclude(61, typeof(FlashlightMetadata))]
[ProtoInclude(62, typeof(BatteryMetadata))]
[ProtoInclude(63, typeof(EscapePodMetadata))]
[ProtoInclude(64, typeof(CrafterMetadata))]
[ProtoInclude(65, typeof(PlantableMetadata))]
[ProtoInclude(66, typeof(CyclopsMetadata))]
[ProtoInclude(67, typeof(RocketMetadata))]
[ProtoInclude(68, typeof(CyclopsLightingMetadata))]
[ProtoInclude(69, typeof(FireExtinguisherHolderMetadata))]
[ProtoInclude(70, typeof(PlayerMetadata))]
[ProtoInclude(71, typeof(GhostMetadata))]
[ProtoInclude(72, typeof(WaterParkCreatureMetadata))]
[ProtoInclude(73, typeof(NamedColoredMetadata))]
[ProtoInclude(74, typeof(BeaconMetadata))]
[ProtoInclude(75, typeof(FlareMetadata))]
[ProtoInclude(76, typeof(RadiationMetadata))]
[ProtoInclude(77, typeof(CrashHomeMetadata))]
[ProtoInclude(78, typeof(EatableMetadata))]
[ProtoInclude(79, typeof(SeaTreaderMetadata))]
[ProtoInclude(80, typeof(StayAtLeashPositionMetadata))]
[ProtoInclude(81, typeof(EggMetadata))]
[ProtoInclude(82, typeof(PlantableMetadata))]
[ProtoInclude(83, typeof(FruitPlantMetadata))]
public abstract class EntityMetadata
{
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class EntitySignMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public string Text { get; }
[DataMember(Order = 2)]
public int ColorIndex { get; }
[DataMember(Order = 3)]
public int ScaleIndex { get; }
[DataMember(Order = 4)]
public bool[] Elements { get; } = [];
[DataMember(Order = 5)]
public bool Background { get; }
[IgnoreConstructor]
protected EntitySignMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public EntitySignMetadata(string text, int colorIndex, int scaleIndex, bool[] elements, bool background)
{
Text = text;
ColorIndex = colorIndex;
ScaleIndex = scaleIndex;
Elements = elements;
Background = background;
}
public override string ToString()
{
return $"[EntitySignMetadata - Text: {Text}, ColorIndex: {ColorIndex}, ScaleIndex: {ScaleIndex}, Elements: {Elements}, Background: {Background}]";
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class EscapePodMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool PodRepaired { get; }
[DataMember(Order = 2)]
public bool RadioRepaired { get; }
[IgnoreConstructor]
protected EscapePodMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public EscapePodMetadata(bool podRepaired, bool radioRepaired)
{
PodRepaired = podRepaired;
RadioRepaired = radioRepaired;
}
public override string ToString()
{
return $"[{nameof(EscapePodMetadata)} - PodRepaired: {PodRepaired}, RadioRepaired: {RadioRepaired}]";
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class ExosuitMetadata : VehicleMetadata
{
[IgnoreConstructor]
protected ExosuitMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public ExosuitMetadata(float health, string name, NitroxVector3[] colors) : base(health, name, colors)
{ }
public override string ToString()
{
return $"[{nameof(ExosuitMetadata)} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class FireExtinguisherHolderMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool HasExtinguisher { get; }
[DataMember(Order = 2)]
public float Fuel { get; }
[IgnoreConstructor]
protected FireExtinguisherHolderMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public FireExtinguisherHolderMetadata(bool hasExtinguisher, float fuel)
{
HasExtinguisher = hasExtinguisher;
Fuel = fuel;
}
public override string ToString()
{
return $"[FireExtinguisherHolderMetadata HasExtinguisher: {HasExtinguisher}, Fuel: {Fuel}]";
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class FlareMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float EnergyLeft { get; }
[DataMember(Order = 2)]
public bool HasBeenThrown { get; }
[DataMember(Order = 3)]
public float? FlareActivateTime { get; }
[IgnoreConstructor]
protected FlareMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public FlareMetadata(float energyLeft, bool hasBeenThrown, float? flareActivateTime)
{
EnergyLeft = energyLeft;
HasBeenThrown = hasBeenThrown;
FlareActivateTime = flareActivateTime;
}
public override string ToString()
{
return $"[FlareMetadata EnergyLeft: {EnergyLeft}, HasBeenThrown: {HasBeenThrown}, FlareActivateTime: {FlareActivateTime}]";
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class FlashlightMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool On { get; }
[IgnoreConstructor]
protected FlashlightMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public FlashlightMetadata(bool on)
{
On = on;
}
public override string ToString()
{
return $"[FlashlightMetadata On: {On}]";
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class FruitPlantMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool[] PickedStates { get; } = [];
[DataMember(Order = 2)]
public float TimeNextFruit { get; }
[IgnoreConstructor]
protected FruitPlantMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public FruitPlantMetadata(bool[] pickedStates, float timeNextFruit)
{
PickedStates = pickedStates;
TimeNextFruit = timeNextFruit;
}
public override string ToString()
{
return $"[{nameof(FruitPlantMetadata)} PickedStates: [{string.Join(", ", PickedStates)}], TimeNextFruit: {TimeNextFruit}]";
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class IncubatorMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Powered { get; }
[DataMember(Order = 2)]
public bool Hatched { get; }
[IgnoreConstructor]
protected IncubatorMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public IncubatorMetadata(bool powered, bool hatched)
{
Powered = powered;
Hatched = hatched;
}
public override string ToString()
{
return $"[IncubatorMetadata Powered: {Powered} Hatched: {Hatched}]";
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class KeypadMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Unlocked { get; }
[IgnoreConstructor]
protected KeypadMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public KeypadMetadata(bool unlocked)
{
Unlocked = unlocked;
}
public override string ToString()
{
return $"[KeypadMetadata isOpen: {Unlocked}]";
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
using ProtoBufNet;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
[ProtoInclude(50, typeof(VehicleMetadata))]
[ProtoInclude(51, typeof(SubNameInputMetadata))]
public abstract class NamedColoredMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public string Name { get; init; }
[DataMember(Order = 2)]
public NitroxVector3[] Colors { get; init; } = [];
[IgnoreConstructor]
protected NamedColoredMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public NamedColoredMetadata(string name, NitroxVector3[] colors) : base()
{
Name = name;
Colors = colors;
}
public override string ToString()
{
return $"[{nameof(NamedColoredMetadata)} Name: {Name}, Colors: {string.Join(";", Colors)} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class PlantableMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float TimeStartGrowth { get; set; }
[DataMember(Order = 2)]
public int SlotID { get; set; }
// TODO: When the metadata system is reworked and we can have multiple metadatas on one entity, this won't be required anymore
[DataMember(Order = 3)]
public FruitPlantMetadata FruitPlantMetadata { get; set; }
[IgnoreConstructor]
protected PlantableMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public PlantableMetadata(float timeStartGrowth, int slotID)
{
TimeStartGrowth = timeStartGrowth;
SlotID = slotID;
}
public PlantableMetadata(float timeStartGrowth, int slotID, FruitPlantMetadata fruitPlantMetadata)
{
TimeStartGrowth = timeStartGrowth;
SlotID = slotID;
FruitPlantMetadata = fruitPlantMetadata;
}
public override string ToString()
{
return $"[{nameof(PlantableMetadata)} TimeStartGrowth: {TimeStartGrowth}, SlotID: {SlotID}, FruitPlantMetadata: {FruitPlantMetadata}]";
}
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class PlayerMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public List<EquippedItem> EquippedItems { get; }
[IgnoreConstructor]
protected PlayerMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public PlayerMetadata(List<EquippedItem> equippedItems)
{
EquippedItems = equippedItems;
}
public override string ToString()
{
return $"[PlayerMetadata EquippedItems: {string.Join(",", EquippedItems)}]";
}
[Serializable]
[DataContract]
public class EquippedItem
{
[DataMember(Order = 1)]
public NitroxId Id { get; }
[DataMember(Order = 2)]
public string Slot { get; }
[DataMember(Order = 3)]
public NitroxTechType TechType { get; }
[IgnoreConstructor]
protected EquippedItem()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public EquippedItem(NitroxId id, string slot, NitroxTechType techType)
{
Id = id;
Slot = slot;
TechType = techType;
}
public override string ToString()
{
return $"[EquippedItem Id: {Id} Slot: {Slot} TechType: {TechType}]";
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class PrecursorDoorwayMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool IsOpen { get; }
[IgnoreConstructor]
protected PrecursorDoorwayMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public PrecursorDoorwayMetadata(bool isOpen)
{
IsOpen = isOpen;
}
public override string ToString()
{
return $"[PrecursorDoorwayMetadata isOpen: {IsOpen}]";
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class PrecursorKeyTerminalMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Slotted { get; }
[IgnoreConstructor]
protected PrecursorKeyTerminalMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public PrecursorKeyTerminalMetadata(bool slotted)
{
Slotted = slotted;
}
public override string ToString()
{
return $"[PrecursorKeyTerminalMetadata Slotted: {Slotted}]";
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class PrecursorTeleporterActivationTerminalMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Unlocked { get; }
[IgnoreConstructor]
protected PrecursorTeleporterActivationTerminalMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public PrecursorTeleporterActivationTerminalMetadata(bool unlocked)
{
Unlocked = unlocked;
}
public override string ToString()
{
return $"[PrecursorTeleporterActivationTerminalMetadata Unlocked: {Unlocked}]";
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class PrecursorTeleporterMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool IsOpen { get; }
[IgnoreConstructor]
protected PrecursorTeleporterMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public PrecursorTeleporterMetadata(bool isOpen)
{
IsOpen = isOpen;
}
public override string ToString()
{
return $"[PrecursorTeleporterMetadata isOpen: {IsOpen}]";
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class RadiationMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float Health { get; set; }
[DataMember(Order = 2)]
public float FixRealTime { get; set; }
[IgnoreConstructor]
protected RadiationMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public RadiationMetadata(float health, float fixRealTime = -1)
{
Health = health;
FixRealTime = fixRealTime;
}
public override string ToString()
{
return $"[{nameof(RadiationMetadata)} Health: {Health}, FixRealTime: {FixRealTime}]";
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class RocketMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public int CurrentStage { get; set; }
[DataMember(Order = 2)]
public float LastStageTransitionTime { get; set; }
[DataMember(Order = 3)]
public int ElevatorState { get; set; }
[DataMember(Order = 4)]
public float ElevatorPosition { get; set; }
[DataMember(Order = 5)]
public List<int> PreflightChecks { get; set; } = [];
[IgnoreConstructor]
protected RocketMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public RocketMetadata(int currentStage, float lastStageTransitionTime, int elevatorState, float elevatorPosition, List<int> preflightChecks)
{
CurrentStage = currentStage;
LastStageTransitionTime = lastStageTransitionTime;
ElevatorState = elevatorState;
ElevatorPosition = elevatorPosition;
PreflightChecks = preflightChecks;
}
public override string ToString()
{
return $"[{nameof(RocketMetadata)} CurrentStage: {CurrentStage}, LastStageTransitionTime: {LastStageTransitionTime}, ElevatorState: {ElevatorState}, ElevatorPosition: {ElevatorPosition}, PreflightChecks: {string.Join(",", PreflightChecks)}]";
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class SeaTreaderMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool ReverseDirection { get; }
[DataMember(Order = 2)]
public float GrazingEndTime { get; }
[DataMember(Order = 3)]
public NitroxVector3 LeashPosition { get; }
[IgnoreConstructor]
protected SeaTreaderMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public SeaTreaderMetadata(bool reverseDirection, float grazingEndTime, NitroxVector3 leashPosition)
{
ReverseDirection = reverseDirection;
GrazingEndTime = grazingEndTime;
LeashPosition = leashPosition;
}
public override string ToString()
{
return $"[{nameof(SeaTreaderMetadata)} ReverseDirection: {ReverseDirection}, GrazingEndTime: {GrazingEndTime}, LeashPosition: {LeashPosition}]";
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class SealedDoorMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool Sealed { get; }
[DataMember(Order = 2)]
public float OpenedAmount { get; }
[IgnoreConstructor]
protected SealedDoorMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public SealedDoorMetadata(bool Sealed, float OpenedAmount)
{
this.Sealed = Sealed;
this.OpenedAmount = OpenedAmount;
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class SeamothMetadata : VehicleMetadata
{
[DataMember(Order = 1)]
public bool LightsOn { get; }
[IgnoreConstructor]
protected SeamothMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public SeamothMetadata(bool lightsOn, float health, string name, NitroxVector3[] colors) : base(health, name, colors)
{
LightsOn = lightsOn;
}
public override string ToString()
{
return $"[{nameof(SeamothMetadata)} LightsOn: {LightsOn} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class StarshipDoorMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public bool DoorLocked { get; }
[DataMember(Order = 2)]
public bool DoorOpen { get; }
[IgnoreConstructor]
protected StarshipDoorMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public StarshipDoorMetadata(bool doorLocked, bool doorOpen)
{
DoorLocked = doorLocked;
DoorOpen = doorOpen;
}
public override string ToString()
{
return $"[StarshipDoorMetadata DoorLocked: {DoorLocked} DoorOpen: {DoorOpen}]";
}
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class StayAtLeashPositionMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public NitroxVector3 LeashPosition { get; }
[IgnoreConstructor]
protected StayAtLeashPositionMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public StayAtLeashPositionMetadata(NitroxVector3 leashPosition)
{
LeashPosition = leashPosition;
}
public override string ToString()
{
return $"[{nameof(StayAtLeashPositionMetadata)} LeashPosition: {LeashPosition}]";
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable]
[DataContract]
public class SubNameInputMetadata : NamedColoredMetadata
{
[DataMember(Order = 1)]
public int SelectedColorIndex { get; }
[IgnoreConstructor]
protected SubNameInputMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public SubNameInputMetadata(int selectedColorIndex, string name, NitroxVector3[] colors) : base(name, colors)
{
SelectedColorIndex = selectedColorIndex;
}
public override string ToString()
{
return $"[{nameof(SubNameInputMetadata)} SelectedColorIndex: {SelectedColorIndex} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.Unity;
using ProtoBufNet;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
[ProtoInclude(50, typeof(SeamothMetadata))]
[ProtoInclude(60, typeof(ExosuitMetadata))]
public abstract class VehicleMetadata : NamedColoredMetadata
{
[DataMember(Order = 1)]
public float Health { get; init; }
[IgnoreConstructor]
protected VehicleMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public VehicleMetadata(float health, string name, NitroxVector3[] colors) : base(name, colors)
{
Health = health;
}
public override string ToString()
{
return $"[{nameof(VehicleMetadata)} Health: {Health} {base.ToString()}]";
}
}

View File

@@ -0,0 +1,40 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata;
[Serializable, DataContract]
public class WaterParkCreatureMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float Age { get; init; }
[DataMember(Order = 2)]
public double MatureTime { get; init; }
[DataMember(Order = 3)]
public float TimeNextBreed { get; init; }
[DataMember(Order = 4)]
public bool BornInside { get; init; }
[IgnoreConstructor]
protected WaterParkCreatureMetadata()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public WaterParkCreatureMetadata(float age, double matureTime, float timeNextBreed, bool bornInside)
{
Age = age;
MatureTime = matureTime;
TimeNextBreed = timeNextBreed;
BornInside = bornInside;
}
public override string ToString()
{
return $"[WaterParkCreatureMetadata Age: {Age}, MatureTime: {MatureTime}, TimeNextBreed: {TimeNextBreed}, BornInside: {BornInside}]";
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
namespace NitroxModel.DataStructures.GameLogic.Entities.Metadata
{
[Serializable]
[DataContract]
public class WeldableWallPanelGenericMetadata : EntityMetadata
{
[DataMember(Order = 1)]
public float LiveMixInHealth { get; }
[IgnoreConstructor]
protected WeldableWallPanelGenericMetadata()
{
//Constructor for serialization. Has to be "protected" for json serialization.
}
public WeldableWallPanelGenericMetadata(float liveMixInHealth)
{
LiveMixInHealth = liveMixInHealth;
}
public override string ToString()
{
return $"[WeldableWallPanelGenericMetadata LiveMixInHealth: {LiveMixInHealth}]";
}
}
}