Interface ICharacterInventorySystem
- Namespace
- FishMMO.Server.Core.World.SceneServer
- Assembly
- FishMMO.Server.dll
Engine-agnostic public API for character inventory operations. Implementations perform item container manipulations and coordinate any necessary database updates or client notifications.
public interface ICharacterInventorySystem : IServerBehaviour, IServerComponent
Methods
SwapContainerItems(IItemContainer, IItemContainer, int, int, out List<Item>, out List<long>, out List<Item>)
Swaps items between two containers and collects the affected items along with any slot deletions that occurred during the cross-container move.
bool SwapContainerItems(IItemContainer from, IItemContainer to, int fromIndex, int toIndex, out List<Item> affectedFromItems, out List<long> deletedFromSlots, out List<Item> affectedToItems)
Parameters
fromIItemContainerSource container.
toIItemContainerDestination container.
fromIndexintSource slot index.
toIndexintDestination slot index.
affectedFromItemsList<Item>Out: items placed into the source container that need persistence.
deletedFromSlotsList<long>Out: slot indices that were vacated in the source container and need deletion.
affectedToItemsList<Item>Out: items placed into the destination container that need persistence.
Returns
- bool
True when the cross-container swap succeeded; otherwise false.
SwapContainerItems(IItemContainer, int, int, out List<Item>)
Swaps two item slots within the same container and collects the affected items.
bool SwapContainerItems(IItemContainer container, int fromIndex, int toIndex, out List<Item> affectedItems)
Parameters
containerIItemContainerThe container instance in which the swap occurs.
fromIndexintSource slot index.
toIndexintTarget slot index.
affectedItemsList<Item>Out: list of items whose slot assignments changed and need persistence.
Returns
- bool
True when the swap succeeded; otherwise false.