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,48 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class BaseLeakEntity : Entity
{
[DataMember(Order = 1)]
public float Health { get; set; }
[DataMember(Order = 2)]
public NitroxInt3 RelativeCell { get; set; }
[IgnoreConstructor]
protected BaseLeakEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public BaseLeakEntity(float health, NitroxInt3 relativeCell, NitroxId leakId, NitroxId parentId)
{
Health = health;
RelativeCell = relativeCell;
Id = leakId;
ParentId = parentId;
}
/// <remarks>Used for deserialization</remarks>
public BaseLeakEntity(float health, NitroxInt3 relativeCell, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities)
{
Health = health;
RelativeCell = relativeCell;
Id = id;
TechType = techType;
Metadata = metadata;
ParentId = parentId;
ChildEntities = childEntities;
}
public override string ToString()
{
return $"[BaseLeakEntity Health: {Health}, RelativeCell: {RelativeCell}]";
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Bases;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class BuildEntity : GlobalRootEntity
{
[DataMember(Order = 1)]
public BaseData BaseData { get; set; }
[IgnoredMember]
public int OperationId;
[IgnoreConstructor]
protected BuildEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public static BuildEntity MakeEmpty()
{
return new BuildEntity();
}
/// <remarks>
/// Used for deserialization.
/// <see cref="WorldEntity.SpawnedByServer"/> is set to true because this entity is meant to receive simulation locks
/// </remarks>
public BuildEntity(BaseData baseData, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(transform, level, classId, true, id, techType, metadata, parentId, childEntities)
{
BaseData = baseData;
}
public override string ToString()
{
return $"[BuildEntity Id: {Id}]";
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Bases;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class GhostEntity : ModuleEntity
{
[DataMember(Order = 1)]
public NitroxBaseFace BaseFace { get; set; }
[DataMember(Order = 2)]
public BaseData BaseData { get; set; }
[IgnoreConstructor]
protected GhostEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public new static GhostEntity MakeEmpty()
{
return new GhostEntity();
}
/// <remarks>Used for deserialization</remarks>
public GhostEntity(NitroxBaseFace baseFace, BaseData baseData, float constructedAmount, bool isInside, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(constructedAmount, isInside, transform, level, classId, spawnedByServer, id, techType, metadata, parentId, childEntities)
{
BaseFace = baseFace;
BaseData = baseData;
}
public override string ToString()
{
return $"[GhostEntity Id: {Id}, ParentId: {ParentId}, ClassId: {ClassId}, Metadata: {Metadata}, ConstructedAmount: {ConstructedAmount}, IsInside: {IsInside}, BaseFace: [{BaseFace}], BaseData: {BaseData}]";
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Bases;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class InteriorPieceEntity : GlobalRootEntity
{
[DataMember(Order = 1)]
public NitroxBaseFace BaseFace;
[IgnoreDataMember]
public bool IsWaterPark => ClassId is "31662630-7cba-4583-8456-2fa1c4cc31aa" or "c2a91864-0f0f-4d8a-99b8-9867571763dd"; // classIds for WaterPark.prefab and WaterParkLarge.prefab
[IgnoreConstructor]
protected InteriorPieceEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public static InteriorPieceEntity MakeEmpty()
{
return new InteriorPieceEntity();
}
/// <remarks>
/// Used for deserialization.
/// <see cref="WorldEntity.SpawnedByServer"/> is set to true because this entity is meant to receive simulation locks
/// </remarks>
public InteriorPieceEntity(NitroxBaseFace baseFace, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(transform, level, classId, true, id, techType, metadata, parentId, childEntities)
{
BaseFace = baseFace;
}
public override string ToString()
{
return $"[InteriorPieceEntity Id: {Id}, ParentId: {ParentId}, BaseFace: {BaseFace}, {base.ToString()}]";
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class MapRoomEntity : GlobalRootEntity
{
[DataMember(Order = 1)]
public NitroxInt3 Cell { get; set; }
[IgnoreConstructor]
protected MapRoomEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public MapRoomEntity(NitroxId id, NitroxId parentId, NitroxInt3 cell)
{
Id = id;
ParentId = parentId;
Cell = cell;
Transform = new();
}
/// <remarks>
/// Used for deserialization.
/// <see cref="WorldEntity.SpawnedByServer"/> is set to true because this entity is meant to receive simulation locks
/// </remarks>
public MapRoomEntity(NitroxInt3 cell, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(transform, level, classId, true, id, techType, metadata, parentId, childEntities)
{
Cell = cell;
}
public override string ToString()
{
return $"[MapRoomEntity Id: {Id}, Cell: {Cell}]";
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
using ProtoBufNet;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
[ProtoInclude(50, typeof(GhostEntity))]
public class ModuleEntity : GlobalRootEntity
{
[DataMember(Order = 1)]
public float ConstructedAmount { get; set; }
[DataMember(Order = 2)]
public bool IsInside { get; set; }
[IgnoreConstructor]
protected ModuleEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public static ModuleEntity MakeEmpty()
{
return new ModuleEntity();
}
/// <remarks>
/// Used for deserialization.
/// <see cref="WorldEntity.SpawnedByServer"/> is set to true because this entity is meant to receive simulation locks
/// </remarks>
public ModuleEntity(float constructedAmount, bool isInside, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(transform, level, classId, true, id, techType, metadata, parentId, childEntities)
{
ConstructedAmount = constructedAmount;
IsInside = isInside;
}
public override string ToString()
{
return $"[ModuleEntity Id: {Id}, ParentId: {ParentId}, ClassId: {ClassId}, ConstructedAmount: {ConstructedAmount}, IsInside: {IsInside}]";
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using BinaryPack.Attributes;
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
using NitroxModel.DataStructures.Unity;
namespace NitroxModel.DataStructures.GameLogic.Entities.Bases;
[Serializable, DataContract]
public class MoonpoolEntity : GlobalRootEntity
{
[DataMember(Order = 1)]
public NitroxInt3 Cell { get; set; }
[IgnoreConstructor]
protected MoonpoolEntity()
{
// Constructor for serialization. Has to be "protected" for json serialization.
}
public MoonpoolEntity(NitroxId id, NitroxId parentId, NitroxInt3 cell)
{
Id = id;
ParentId = parentId;
Cell = cell;
}
/// <remarks>
/// Used for deserialization.
/// <see cref="WorldEntity.SpawnedByServer"/> is set to true because this entity is meant to receive simulation locks
/// </remarks>
public MoonpoolEntity(NitroxInt3 cell, NitroxTransform transform, int level, string classId, bool spawnedByServer, NitroxId id, NitroxTechType techType, EntityMetadata metadata, NitroxId parentId, List<Entity> childEntities) :
base(transform, level, classId, true, id, techType, metadata, parentId, childEntities)
{
Cell = cell;
}
public override string ToString()
{
return $"[MoonpoolEntity Id: {Id}, Cell: {Cell}]";
}
}