ItemSlot - jimdroberts/FishMMO GitHub Wiki

Description

Represents the possible equipment slots for items on a character. Used to determine where an item can be equipped.


API Access

Fields

  • 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).


Basic Usage

Setup

  1. Use the ItemSlot enum to specify or check the slot for equippable items.
  2. Integrate ItemSlot with equipment, inventory, and character systems as needed.

Example

// 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;
}

Best Practices

  • 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.
⚠️ **GitHub.com Fallback** ⚠️