InventoryType - jimdroberts/FishMMO GitHub Wiki

Description

Specifies the types of inventories available to a character, used for item management and slot operations.


API Access

Fields

  • Inventory

    The main inventory for storing general items.

  • Equipment

    The equipment inventory for storing equipped items (e.g., armor, weapons).

  • Bank

    The bank inventory for storing items in a bank or safe location.


Basic Usage

Setup

  1. Use the InventoryType enum to specify the type of inventory when performing item management or slot operations.
  2. Integrate InventoryType with inventory, equipment, and bank systems as needed.

Example

// Example 1: Checking inventory type before performing an operation
InventoryType type = InventoryType.Equipment;
if (type == InventoryType.Equipment) {
    // Perform equipment-specific logic
}

// Example 2: Switching behavior based on inventory type
switch (type) {
    case InventoryType.Inventory:
        // Handle general inventory logic
        break;
    case InventoryType.Equipment:
        // Handle equipment logic
        break;
    case InventoryType.Bank:
        // Handle bank logic
        break;
}

Best Practices

  • Always use InventoryType to clearly distinguish between inventory, equipment, and bank operations.
  • Document any custom inventory types if you extend the enum.
  • Use descriptive comments for each enum value to aid maintainability.
⚠️ **GitHub.com Fallback** ⚠️