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 public static class EquipmentSlotDefines
{ {
/// <summary>
/// Uniquely identifies a single slot in an inventory.
/// </summary>
[Serializable, NetSerializable] [Serializable, NetSerializable]
public enum Slots public enum Slots
{ {
@@ -29,6 +32,9 @@ namespace Content.Shared.GameObjects.Components.Inventory
EXOSUITSLOT2 EXOSUITSLOT2
} }
/// <summary>
/// Defines what slot types an item can fit into.
/// </summary>
[Serializable, NetSerializable] [Serializable, NetSerializable]
[Flags] [Flags]
public enum SlotFlags public enum SlotFlags
@@ -55,46 +61,52 @@ namespace Content.Shared.GameObjects.Components.Inventory
EXOSUITSTORAGE = 1 << 14 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.HEAD, "Head"},
{Slots.EYES, "Eyes" }, {Slots.EYES, "Eyes"},
{Slots.EARS, "Ears" }, {Slots.EARS, "Ears"},
{Slots.MASK, "Mask" }, {Slots.MASK, "Mask"},
{Slots.OUTERCLOTHING, "Outer Clothing" }, {Slots.OUTERCLOTHING, "Outer Clothing"},
{Slots.INNERCLOTHING, "Inner Clothing" }, {Slots.INNERCLOTHING, "Inner Clothing"},
{Slots.BACKPACK, "Backpack" }, {Slots.BACKPACK, "Backpack"},
{Slots.BELT, "Belt" }, {Slots.BELT, "Belt"},
{Slots.GLOVES, "Gloves" }, {Slots.GLOVES, "Gloves"},
{Slots.SHOES, "Shoes" }, {Slots.SHOES, "Shoes"},
{Slots.IDCARD, "Id Card" }, {Slots.IDCARD, "Id Card"},
{Slots.POCKET1, "Left Pocket" }, {Slots.POCKET1, "Left Pocket"},
{Slots.POCKET2, "Right Pocket" }, {Slots.POCKET2, "Right Pocket"},
{Slots.POCKET3, "Up Pocket" }, {Slots.POCKET3, "Up Pocket"}, // What?
{Slots.POCKET4, "Down Pocket" }, {Slots.POCKET4, "Down Pocket"}, // I, uh, what?
{Slots.EXOSUITSLOT1, "Suit Storage" }, {Slots.EXOSUITSLOT1, "Suit Storage"},
{Slots.EXOSUITSLOT2, "Backup 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.HEAD, SlotFlags.HEAD},
{Slots.EYES, SlotFlags.EYES }, {Slots.EYES, SlotFlags.EYES},
{Slots.EARS, SlotFlags.EARS }, {Slots.EARS, SlotFlags.EARS},
{Slots.MASK, SlotFlags.MASK }, {Slots.MASK, SlotFlags.MASK},
{Slots.OUTERCLOTHING, SlotFlags.OUTERCLOTHING }, {Slots.OUTERCLOTHING, SlotFlags.OUTERCLOTHING},
{Slots.INNERCLOTHING, SlotFlags.INNERCLOTHING }, {Slots.INNERCLOTHING, SlotFlags.INNERCLOTHING},
{Slots.BACKPACK, SlotFlags.BACK }, {Slots.BACKPACK, SlotFlags.BACK},
{Slots.BELT, SlotFlags.BELT }, {Slots.BELT, SlotFlags.BELT},
{Slots.GLOVES, SlotFlags.GLOVES }, {Slots.GLOVES, SlotFlags.GLOVES},
{Slots.SHOES, SlotFlags.FEET }, {Slots.SHOES, SlotFlags.FEET},
{Slots.IDCARD, SlotFlags.IDCARD }, {Slots.IDCARD, SlotFlags.IDCARD},
{Slots.POCKET1, SlotFlags.POCKET }, {Slots.POCKET1, SlotFlags.POCKET},
{Slots.POCKET2, SlotFlags.POCKET }, {Slots.POCKET2, SlotFlags.POCKET},
{Slots.POCKET3, SlotFlags.POCKET }, {Slots.POCKET3, SlotFlags.POCKET},
{Slots.POCKET4, SlotFlags.POCKET }, {Slots.POCKET4, SlotFlags.POCKET},
{Slots.EXOSUITSLOT1, SlotFlags.EXOSUITSTORAGE }, {Slots.EXOSUITSLOT1, SlotFlags.EXOSUITSTORAGE},
{Slots.EXOSUITSLOT2, SlotFlags.EXOSUITSTORAGE } {Slots.EXOSUITSLOT2, SlotFlags.EXOSUITSTORAGE}
}; };
} }
} }