Fix solution visuals (#13456)

This commit is contained in:
Leon Friedrich
2023-01-14 13:21:15 +13:00
committed by GitHub
parent 60ba6fa51e
commit 84e7525ea4
3 changed files with 12 additions and 41 deletions

View File

@@ -5,39 +5,8 @@ namespace Content.Shared.Chemistry
[Serializable, NetSerializable]
public enum SolutionContainerVisuals : byte
{
VisualState
}
[Serializable, NetSerializable]
public sealed class SolutionContainerVisualState : ICloneable
{
public readonly Color Color;
public readonly byte FilledVolumeFraction;
// do we really need this just to save three bytes?
// This does seem silly
public float FilledVolumePercent => (float) FilledVolumeFraction / byte.MaxValue;
/// <summary>
/// Sets the solution state of a container.
/// </summary>
public SolutionContainerVisualState(Color color, float filledVolumePercent)
{
Color = color;
FilledVolumeFraction = (byte) (byte.MaxValue * filledVolumePercent);
}
public SolutionContainerVisualState(Color color, byte filledVolumeFraction)
{
Color = color;
FilledVolumeFraction = filledVolumeFraction;
}
public object Clone()
{
return new SolutionContainerVisualState(Color, FilledVolumeFraction);
}
Color,
FillFraction,
}
public enum SolutionContainerLayers : byte