Table of Contents

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

from IItemContainer

Source container.

to IItemContainer

Destination container.

fromIndex int

Source slot index.

toIndex int

Destination slot index.

affectedFromItems List<Item>

Out: items placed into the source container that need persistence.

deletedFromSlots List<long>

Out: slot indices that were vacated in the source container and need deletion.

affectedToItems List<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

container IItemContainer

The container instance in which the swap occurs.

fromIndex int

Source slot index.

toIndex int

Target slot index.

affectedItems List<Item>

Out: list of items whose slot assignments changed and need persistence.

Returns

bool

True when the swap succeeded; otherwise false.