-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equipment Slot Helpers #147
Milestone
Comments
pavlicekdominik
added a commit
that referenced
this issue
Nov 26, 2023
pavlicekdominik
added a commit
that referenced
this issue
Nov 27, 2023
pavlicekdominik
added a commit
that referenced
this issue
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Function: DoesSlotExist
Purpose: To check if an equipment slot with the given name exists.
Inputs:
FName
: The name of the slot to check for existence.Returns:
bool
: True if the slot exists, False otherwise.Description: Checks the equipment system to see if a slot with the specified name is available.
Pseudocode:
Function DoesSlotExist(SlotName: FName) -> bool: For each equipmentSlot in EquipmentSlots: If equipmentSlot.SlotName == SlotName: Return true Return false End Function
Function: GetEquipmentSlot
Purpose: To retrieve a single equipment slot based on the specified criteria.
Inputs:
FEquipmentSlotSearchCriteria
: The criteria to search for.Returns:
FEquipmentItemSlot
: An equipment slot that matches the criteria.Description: Searches the equipment system for the first slot matching the criteria.
Pseudocode:
Function GetEquipmentSlot(Criteria: FEquipmentSlotSearchCriteria) -> FEquipmentItemSlot: If Criteria.IsValid(): For each equipmentSlot in EquipmentSlots: If Criteria.SearchByName and equipmentSlot.SlotName == Criteria.SlotName: Return equipmentSlot If Criteria.SearchByItem and equipmentSlot.ItemSlot.ItemInstance == Criteria.ItemInstance: Return equipmentSlot If Criteria.SearchByGuid and equipmentSlot.SlotGuid == Criteria.SlotGuid: Return equipmentSlot If Criteria.SearchByTag and equipmentSlot.AcceptedTags.HasTag(Criteria.Tag): Return equipmentSlot If Criteria.ItemCategory and equipmentSlot.AcceptedCategories.Contains(Criteria.ItemCategory): Return equipmentSlot Else: Return nullptr End If Return nullptr
Function: GetEquipmentSlots
Purpose: To retrieve equipment slots based on the specified criteria, or just all.
Inputs:
FEquipmentSlotSearchCriteria
: The criteria to search for.Returns:
TArray<FEquipmentItemSlot>
: A list of equipment slots that match the criteria.Description: Searches the equipment system for slots matching the criteria. If no criteria are provided, it returns all slots.
Pseudocode:
Function GetEquipmentSlots(Criteria: FEquipmentSlotSearchCriteria) -> TArray<FEquipmentItemSlot>: ResultSlots = TArray<FEquipmentItemSlot>() If Criteria.IsValid(): For each equipmentSlot in EquipmentSlots: If Criteria.SearchByName and equipmentSlot.SlotName == Criteria.SlotName: ResultSlots.Add(equipmentSlot) Continue If Criteria.SearchByItem and equipmentSlot.ItemSlot.ItemInstance == Criteria.ItemInstance: ResultSlots.Add(equipmentSlot) Continue If Criteria.SearchByGuid and equipmentSlot.SlotGuid == Criteria.SlotGuid: ResultSlots.Add(equipmentSlot) Continue If Criteria.SearchByTag and equipmentSlot.AcceptedTags.HasTag(Criteria.Tag): ResultSlots.Add(equipmentSlot) Continue If Criteria.ItemCategory and equipmentSlot.AcceptedCategories.Contains(Criteria.ItemCategory): ResultSlots.Add(equipmentSlot) Continue Else: Return EquipmentSlots End If Return ResultSlots End Function
Function: IsSlotValid
Purpose: To validate the integrity of an
FEquipmentItemSlot
.Inputs:
FEquipmentItemSlot
Slot: The equipment slot intended for validation.Returns:
bool
: True if the slot is valid, False otherwise.Description: Ensures that the provided slot has:
Pseudocode:
Function: CanItemBeEquipped
Purpose: To check if an item can be equipped in a given equipment slot.
Inputs:
UInstancedItem*
Item: The item intended to be equipped.FEquipmentItemSlot
Slot: The equipment slot to which the item is intended to be equipped.Returns:
bool
: True if the item can be equipped in the slot, False otherwise.Description: This function verifies if the item's tags and category match the accepted tags and categories of the equipment slot.
Pseudocode:
Function: IsSlotOccupied
Purpose: To determine if an equipment slot is currently occupied by an item.
Inputs:
FEquipmentItemSlot
Slot: The equipment slot to check.Returns:
bool
: True if the slot is occupied, False otherwise.Description: A straightforward function to verify if an item occupies the slot.
Pseudocode:
Function IsSlotOccupied(Slot: FEquipmentItemSlot) -> bool: If Slot.ItemSlot.ItemInstance is not nullptr: Return true Else: Return false End Function
The text was updated successfully, but these errors were encountered: