Files
crystall-punk-14/Content.Shared/Nutrition/Components/SharedHungerComponent.cs

34 lines
868 B
C#
Raw Normal View History

using Robust.Shared.GameStates;
2020-06-24 02:21:20 +02:00
using Robust.Shared.Serialization;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Nutrition.Components
2020-06-24 02:21:20 +02:00
{
[NetworkedComponent()]
public abstract class SharedHungerComponent : Component
2020-06-24 02:21:20 +02:00
{
[ViewVariables]
2020-06-24 02:21:20 +02:00
public abstract HungerThreshold CurrentHungerThreshold { get; }
[Serializable, NetSerializable]
protected sealed class HungerComponentState : ComponentState
{
public HungerThreshold CurrentThreshold { get; }
public HungerComponentState(HungerThreshold currentThreshold)
2020-06-24 02:21:20 +02:00
{
CurrentThreshold = currentThreshold;
}
}
}
[Serializable, NetSerializable]
2020-06-24 02:21:20 +02:00
public enum HungerThreshold : byte
{
Overfed = 1 << 3,
Okay = 1 << 2,
Peckish = 1 << 1,
Starving = 1 << 0,
Dead = 0,
2020-06-24 02:21:20 +02:00
}
}