Clean up EquipmentSlotDefinitions.cs a bit.

This commit is contained in:
Pieter-Jan Briers
2020-01-20 00:25:03 +01:00
parent 7c562af0aa
commit 959bf7c477

View File

@@ -6,6 +6,9 @@ namespace Content.Shared.GameObjects.Components.Inventory
{
public static class EquipmentSlotDefines
{
/// <summary>
/// Uniquely identifies a single slot in an inventory.
/// </summary>
[Serializable, NetSerializable]
public enum Slots
{
@@ -29,6 +32,9 @@ namespace Content.Shared.GameObjects.Components.Inventory
EXOSUITSLOT2
}
/// <summary>
/// Defines what slot types an item can fit into.
/// </summary>
[Serializable, NetSerializable]
[Flags]
public enum SlotFlags
@@ -55,7 +61,7 @@ namespace Content.Shared.GameObjects.Components.Inventory
EXOSUITSTORAGE = 1 << 14
}
public static Dictionary<Slots, string> SlotNames = new Dictionary<Slots, string>()
public static readonly IReadOnlyDictionary<Slots, string> SlotNames = new Dictionary<Slots, string>()
{
{Slots.HEAD, "Head"},
{Slots.EYES, "Eyes"},
@@ -70,13 +76,19 @@ namespace Content.Shared.GameObjects.Components.Inventory
{Slots.IDCARD, "Id Card"},
{Slots.POCKET1, "Left Pocket"},
{Slots.POCKET2, "Right Pocket"},
{Slots.POCKET3, "Up Pocket" },
{Slots.POCKET4, "Down Pocket" },
{Slots.POCKET3, "Up Pocket"}, // What?
{Slots.POCKET4, "Down Pocket"}, // I, uh, what?
{Slots.EXOSUITSLOT1, "Suit Storage"},
{Slots.EXOSUITSLOT2, "Backup Storage"}
};
public static Dictionary<Slots, SlotFlags> SlotMasks = new Dictionary<Slots, SlotFlags>()
/// <summary>
/// Defines which slot types fit in which slots.
/// </summary>
/// <remarks>
/// Note that this is not exhaustive. Inventory implementations can provide additional behavior.
/// </remarks>
public static readonly IReadOnlyDictionary<Slots, SlotFlags> SlotMasks = new Dictionary<Slots, SlotFlags>()
{
{Slots.HEAD, SlotFlags.HEAD},
{Slots.EYES, SlotFlags.EYES},