Refactor Flammable to be ECS. (#4671)
- Refactor IHotItem into IsHotEvent. - Refactor IFireAct into TileFireEvent.
This commit is contained in:
committed by
GitHub
parent
9bde39c533
commit
6cea9cb973
@@ -33,9 +33,8 @@ namespace Content.Server.Tools.Components
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(ToolComponent))]
|
||||
[ComponentReference(typeof(IToolComponent))]
|
||||
[ComponentReference(typeof(IHotItem))]
|
||||
[NetworkedComponent()]
|
||||
public class WelderComponent : ToolComponent, IUse, ISuicideAct, IHotItem, IAfterInteract
|
||||
public class WelderComponent : ToolComponent, IUse, ISuicideAct, IAfterInteract
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
@@ -98,11 +97,6 @@ namespace Content.Server.Tools.Components
|
||||
}
|
||||
}
|
||||
|
||||
bool IHotItem.IsCurrentlyHot()
|
||||
{
|
||||
return WelderLit;
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using Content.Server.Tools.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Temperature;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
@@ -21,9 +22,15 @@ namespace Content.Server.Tools
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<WelderComponent, SolutionChangedEvent>(OnSolutionChange);
|
||||
SubscribeLocalEvent<WelderComponent, IsHotEvent>(OnIsHotEvent);
|
||||
SubscribeLocalEvent<WelderComponent, ExaminedEvent>(OnExamine);
|
||||
}
|
||||
|
||||
private void OnIsHotEvent(EntityUid uid, WelderComponent component, IsHotEvent args)
|
||||
{
|
||||
args.IsHot = component.WelderLit;
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, WelderComponent component, ExaminedEvent args)
|
||||
{
|
||||
if (component.WelderLit)
|
||||
|
||||
Reference in New Issue
Block a user