ItemSlot - jimdroberts/FishMMO GitHub Wiki
Represents the possible equipment slots for items on a character. Used to determine where an item can be equipped.
-
Head
Head slot (e.g., helmets, hats).
-
Chest
Chest slot (e.g., armor, shirts).
-
Legs
Legs slot (e.g., pants, leggings).
-
Hands
Hands slot (e.g., gloves, gauntlets).
-
Feet
Feet slot (e.g., boots, shoes).
-
Primary
Primary weapon slot (e.g., sword, staff).
-
Secondary
Secondary weapon slot (e.g., shield, offhand).
- Use the ItemSlot enum to specify or check the slot for equippable items.
- Integrate ItemSlot with equipment, inventory, and character systems as needed.
// Example 1: Assigning an item to a slot
ItemSlot slot = ItemSlot.Head;
// Example 2: Switching logic based on slot
switch (slot) {
case ItemSlot.Primary:
// Handle primary weapon logic
break;
case ItemSlot.Feet:
// Handle boots logic
break;
}
- Use ItemSlot to clearly define where items can be equipped on a character.
- Document any custom slots if you extend the enum for new equipment types.
- Use descriptive comments for each enum value to aid maintainability.