Component Messaging Rework (#36)

* Remove DiscoBall.

* Changes `IEntity.AddComponent(IComponent)` to `IEntity.AddComponent<T>`.

* Pulled ComponentManager registration out of Component into Entity.

* Killed component message params.

* Updated engine submodule.
This commit is contained in:
Acruid
2018-02-24 11:48:23 -08:00
committed by GitHub
parent 05d4b2793b
commit b005d661f8
11 changed files with 24 additions and 95 deletions

View File

@@ -60,7 +60,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="EntryPoint.cs" />
<Compile Include="Prototypes\DiscoBall.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GameObjects\Components\Items\ClientHandsComponent.cs" />
<Compile Include="GameObjects\Components\Doors\ClientDoorComponent.cs" />

View File

@@ -1,10 +1,7 @@
using Content.Client.Interfaces.GameObjects;
using Content.Client.UserInterface;
using Content.Shared.GameObjects;
using Lidgren.Network;
using SS14.Client.Interfaces.UserInterface;
using SS14.Client.UserInterface;
using SS14.Shared;
using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.IoC;
@@ -50,7 +47,7 @@ namespace Content.Client.GameObjects
public void SendChangeHand(string index)
{
Owner.SendComponentNetworkMessage(this, NetDeliveryMethod.ReliableUnordered, index);
SendNetworkMessage(new ClientChangedHandMsg(index));
}
}
}

View File

@@ -1,39 +0,0 @@
using SS14.Client.GameObjects;
using SS14.Shared.GameObjects;
using SS14.Shared.Maths;
namespace Content.Client.Prototypes
{
// Instantiated through reflection by the prototype system.
public class DiscoBall : Entity
{
private PointLightComponent _lightComponent;
private float _hue;
/// <inheritdoc />
public override void Initialize()
{
base.Initialize();
_lightComponent = GetComponent<PointLightComponent>();
}
/// <inheritdoc />
public override void Shutdown()
{
base.Shutdown();
_lightComponent = null;
}
/// <inheritdoc />
public override void Update(float frameTime)
{
_hue += frameTime / 10;
if (_hue > 1)
{
_hue -= 1;
}
_lightComponent.Color = Color4.FromHsl(new Vector4(_hue, 1, 0.5f, 0.5f));
}
}
}