using System; using Robust.Shared.Maths; using Robust.Shared.Serialization; namespace Content.Shared.Chemistry { [Serializable, NetSerializable] public enum SolutionContainerVisuals : byte { VisualState } [Serializable, NetSerializable] public class SolutionContainerVisualState { public readonly Color Color; /// /// Represents how full the container is, as a fraction equivalent to /. /// public readonly byte FilledVolumeFraction; // do we really need this just to save three bytes? public float FilledVolumePercent => (float) FilledVolumeFraction / byte.MaxValue; /// /// Sets the solution state of a container. /// /// /// The fraction of the container's volume that is filled. public SolutionContainerVisualState(Color color, float filledVolumeFraction) { Color = color; FilledVolumeFraction = (byte) (byte.MaxValue * filledVolumeFraction); } } public enum SolutionContainerLayers : byte { Fill, Base } }