Files
tbd-station-14/Content.Shared/Chemistry/SolutionCaps.cs
py01 2d1fe31bce SolutionContainerComponent refactors (#2746)
* Moves ContainsReagent from SolutionContainer to Solution

* GetMajorReagentId from SOlutionContainer to Solution

* Makes capability checks use HasFlag

* Moves Solution Color calculation from SolutionContainer to Solution

* Replaces SolutionContainerCaps.NoExamine with CanExamine

* Misc SolutionContainer.Capabilities yaml cleanup

* Removes HasFlag usage in SolutionContainerComponent

Co-authored-by: py01 <pyronetics01@gmail.com>
2021-01-06 13:31:41 +01:00

47 lines
1.3 KiB
C#

using System;
using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry
{
/// <summary>
/// These are the defined capabilities of a container of a solution.
/// </summary>
[Flags]
[Serializable, NetSerializable]
public enum SolutionContainerCaps
{
None = 0,
/// <summary>
/// Can solutions be added into the container?
/// </summary>
AddTo = 1,
/// <summary>
/// Can solutions be removed from the container?
/// </summary>
RemoveFrom = 2,
/// <summary>
/// Allows the container to be placed in a <c>ReagentDispenserComponent</c>.
/// <para>Otherwise it's considered to be too large or the improper shape to fit.</para>
/// <para>Allows us to have obscenely large containers that are harder to abuse in chem dispensers
/// since they can't be placed directly in them.</para>
/// </summary>
FitsInDispenser = 4,
/// <summary>
/// Can people examine the solution in the container or is it impossible to see?
/// </summary>
CanExamine = 8,
}
public static class SolutionContainerCapsHelpers
{
public static bool HasCap(this SolutionContainerCaps cap, SolutionContainerCaps other)
{
return (cap & other) == other;
}
}
}