Fix solution visuals (#13456)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user