Removes the ConstructorComponents and moves the construction blueprint feature into a new ECS system. (#1114)

This commit is contained in:
Acruid
2020-06-15 12:30:11 -07:00
committed by GitHub
parent 548b91df61
commit 189ed9309f
11 changed files with 302 additions and 330 deletions

View File

@@ -26,6 +26,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="GameObjects\Components\Construction\" />
<Folder Include="GameObjects\Components\Trigger\" />
<EmbeddedResource Include="Text\Names\*.txt" />
</ItemGroup>

View File

@@ -11,7 +11,8 @@
public const uint STORAGE = 1005;
public const uint INVENTORY = 1006;
public const uint POWER_DEBUG_TOOL = 1007;
public const uint CONSTRUCTOR = 1008;
// 1008
// 1009
public const uint RANGED_WEAPON = 1010;
public const uint CAMERA_RECOIL = 1011;
public const uint SOUND = 1012;

View File

@@ -1,25 +1,22 @@
using System;
using System;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Construction
namespace Content.Shared.GameObjects.EntitySystems
{
/// <summary>
/// Basically handles the logic of "this mob can do construction".
/// </summary>
public abstract class SharedConstructorComponent : Component
[UsedImplicitly]
public class ConstructionSystem : EntitySystem
{
public override string Name => "Constructor";
public override uint? NetID => ContentNetIDs.CONSTRUCTOR;
/// <summary>
/// Sent client -> server to to tell the server that we started building
/// a structure-construction.
/// </summary>
[Serializable, NetSerializable]
protected class TryStartStructureConstructionMessage : ComponentMessage
public class TryStartStructureConstructionMessage : EntitySystemMessage
{
/// <summary>
/// Position to start building.
@@ -40,7 +37,6 @@ namespace Content.Shared.GameObjects.Components.Construction
public TryStartStructureConstructionMessage(GridCoordinates loc, string prototypeName, Angle angle, int ack)
{
Directed = true;
Location = loc;
PrototypeName = prototypeName;
Angle = angle;
@@ -53,7 +49,7 @@ namespace Content.Shared.GameObjects.Components.Construction
/// an item-construction.
/// </summary>
[Serializable, NetSerializable]
protected class TryStartItemConstructionMessage : ComponentMessage
public class TryStartItemConstructionMessage : EntitySystemMessage
{
/// <summary>
/// The construction prototype to start building.
@@ -62,21 +58,21 @@ namespace Content.Shared.GameObjects.Components.Construction
public TryStartItemConstructionMessage(string prototypeName)
{
Directed = true;
PrototypeName = prototypeName;
}
}
/// <summary>
/// Send server -> client to tell the client that a ghost has started to be constructed.
/// </summary>
[Serializable, NetSerializable]
protected class AckStructureConstructionMessage : ComponentMessage
public class AckStructureConstructionMessage : EntitySystemMessage
{
public readonly int Ack;
public readonly int GhostId;
public AckStructureConstructionMessage(int ack)
public AckStructureConstructionMessage(int ghostId)
{
Directed = true;
Ack = ack;
GhostId = ghostId;
}
}
}