Files
OldThink/Content.Client/Lathe/Components/MaterialStorageComponent.cs

25 lines
814 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2021-06-09 22:19:39 +02:00
using Content.Shared.Lathe;
using Robust.Shared.GameObjects;
2021-06-09 22:19:39 +02:00
namespace Content.Client.Lathe.Components
{
2019-07-31 15:02:36 +02:00
[RegisterComponent]
[ComponentReference(typeof(SharedMaterialStorageComponent))]
public sealed class MaterialStorageComponent : SharedMaterialStorageComponent
{
protected override Dictionary<string, int> Storage { get; set; } = new();
public event Action? OnMaterialStorageChanged;
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (curState is not MaterialStorageState state) return;
Storage = state.Storage;
OnMaterialStorageChanged?.Invoke();
}
}
}