Remove ILand (#4582)
* Remove ILand * Make land not handleable * Rename ILand
This commit is contained in:
@@ -33,11 +33,8 @@ namespace Content.Server.Light.Components
|
||||
/// Component that represents a light bulb. Can be broken, or burned, which turns them mostly useless.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class LightBulbComponent : Component, ILand, IBreakAct
|
||||
public class LightBulbComponent : Component, IBreakAct
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked whenever the state of the light bulb changes.
|
||||
/// </summary>
|
||||
@@ -121,12 +118,6 @@ namespace Content.Server.Light.Components
|
||||
UpdateColor();
|
||||
}
|
||||
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
PlayBreakSound();
|
||||
State = LightBulbState.Broken;
|
||||
}
|
||||
|
||||
public void OnBreak(BreakageEventArgs eventArgs)
|
||||
{
|
||||
State = LightBulbState.Broken;
|
||||
|
||||
21
Content.Server/Light/EntitySystems/LightBulbSystem.cs
Normal file
21
Content.Server/Light/EntitySystems/LightBulbSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Server.Light.Components;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
public sealed class LightBulbSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<LightBulbComponent, LandEvent>(HandleLand);
|
||||
}
|
||||
|
||||
private void HandleLand(EntityUid uid, LightBulbComponent component, LandEvent args)
|
||||
{
|
||||
component.PlayBreakSound();
|
||||
component.State = LightBulbState.Broken;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user