first commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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}]";
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user