Mountea-Framework/MounteaInventoryEquipment

Inventory Action Sort

pavlicekdominik opened this issue · 0 comments

Class: Sort Items

Inherits: UMounteaInventoryItemAction

Purpose

To define the sorting logic for inventory items based on specified criteria such as category, rarity, quantity, value, and weight.

Properties

  • bSortByCategory: Boolean to sort by category
  • bSortByRarity: Boolean to sort by rarity
  • bSortByQuantity: Boolean to sort by quantity
  • bSortByValue: Boolean to sort by value
  • bSortByWeight: Boolean to sort by weight

Methods

Function: ExecuteSort
  • Inputs: None
  • Outputs: None
  • Purpose: Contains the logic to sort inventory items based on the specified properties.

Usage

When ProcessAction is called, it will trigger ExecuteSort if the associated boolean property is true. The ExecuteSort function will perform the actual sorting of items based on the defined criteria.

Function ProcessAction() -> void:
    If bSortByCategory:
        ExecuteSort(byCategory)
    Else If bSortByRarity:
        ExecuteSort(byRarity)
    Else If bSortByQuantity:
        ExecuteSort(byQuantity)
    Else If bSortByValue:
        ExecuteSort(byValue)
    Else If bSortByWeight:
        ExecuteSort(byWeight)
End Function