2021-02-27 04:12:09 +01:00
|
|
|
using System;
|
2021-11-03 16:48:03 -07:00
|
|
|
using Content.Shared.FixedPoint;
|
2020-02-23 19:47:33 -05:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2020-02-23 19:47:33 -05:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Chemistry.Components
|
2020-02-23 19:47:33 -05:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shared class for injectors & syringes
|
|
|
|
|
/// </summary>
|
2022-02-07 00:34:13 +11:00
|
|
|
[NetworkedComponent, ComponentProtoName("Injector")]
|
|
|
|
|
public abstract class SharedInjectorComponent : Component
|
2020-02-23 19:47:33 -05:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Component data used for net updates. Used by client for item status ui
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-07 00:34:13 +11:00
|
|
|
public sealed class InjectorComponentState : ComponentState
|
2020-02-23 19:47:33 -05:00
|
|
|
{
|
2021-11-03 16:48:03 -07:00
|
|
|
public FixedPoint2 CurrentVolume { get; }
|
|
|
|
|
public FixedPoint2 TotalVolume { get; }
|
2020-02-23 19:47:33 -05:00
|
|
|
public InjectorToggleMode CurrentMode { get; }
|
|
|
|
|
|
2022-02-07 00:34:13 +11:00
|
|
|
public InjectorComponentState(FixedPoint2 currentVolume, FixedPoint2 totalVolume, SharedInjectorComponent.InjectorToggleMode currentMode)
|
2020-02-23 19:47:33 -05:00
|
|
|
{
|
|
|
|
|
CurrentVolume = currentVolume;
|
|
|
|
|
TotalVolume = totalVolume;
|
|
|
|
|
CurrentMode = currentMode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-07 00:34:13 +11:00
|
|
|
public enum InjectorToggleMode : byte
|
2020-02-23 19:47:33 -05:00
|
|
|
{
|
|
|
|
|
Inject,
|
|
|
|
|
Draw
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|