Files
RobustToolbox/Robust.Server/GameObjects/Components/Light/PointLightComponent.cs
Pieter-Jan Briers fdfbf92223 Remove a ton of lighting system cruft.
Basically just kills the light manager.
Clyde was already using the ECS anyways.
2019-07-30 13:31:05 +02:00

79 lines
1.9 KiB
C#

using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Robust.Server.GameObjects
{
public class PointLightComponent : Component
{
private Color _color;
private bool _enabled;
private int _radius;
private Vector2 _offset;
public override string Name => "PointLight";
public override uint? NetID => NetIDs.POINT_LIGHT;
[ViewVariables(VVAccess.ReadWrite)]
public Color Color
{
get => _color;
set
{
_color = value;
Dirty();
}
}
[ViewVariables]
public bool Enabled
{
get => _enabled;
set
{
_enabled = value;
Dirty();
}
}
[ViewVariables(VVAccess.ReadWrite)]
public int Radius
{
get => _radius;
set
{
_radius = value;
Dirty();
}
}
[ViewVariables(VVAccess.ReadWrite)]
public Vector2 Offset
{
get => _offset;
set
{
_offset = value;
Dirty();
}
}
/// <inheritdoc />
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _enabled, "enabled", true);
serializer.DataField(ref _color, "color", new Color(200, 200, 200));
serializer.DataField(ref _radius, "radius", 512);
serializer.DataField(ref _offset, "offset", Vector2.Zero);
}
public override ComponentState GetComponentState()
{
return new PointLightComponentState(Enabled, Color, Radius, Offset);
}
}
}