Skip to main content

Index Queue

This in the data structure we used to process InworldPackets in the Inworld client. We used a list to host a queue, so that we can also get the data from the indices.

IContainable

Module: Inworld.AI. Namespace: Inworld.Interactions.

This is the interface of the Index queue. Index queue is just one form of the IContainable.

Interface Properties

PropertiesDescription
IDThe ID of the conatainable object.
RecentTimeThe recent visit time of the object.
IsEmptyCheck if the containable object is empty.

Interface functions

FunctionDescriptionParameters
ContainsCheck if it contains the target InworldPacket.InworldPacket: target packet.
AddAdd an InworldPacket into the containable object.InworldPacket: target packet.
CancelCancel this current containable object.
(Usually pour this object to another object)
isHardCancelling: if you also need to clear the content inside.
OnDequeueTriggers when this containable object is dequeuing.

IndexQueue<T>

Module: Inworld.AI. Namespace: Inworld.Interactions. where T: IContainable

Variables

VariablesDescription
ElementsThe list of the elements of class T.

Properties

PropertiesDescription
RecentTimeThe recent visit time of the object.
Countthe count of the elements.
IsEmptyCheck if the containable object is empty.
this[index]It also supports using [] to visit the element T with the exact index.

API

FunctionDescriptionParameters
ContainsCheck if it contains the target InworldPacket.InworldPacket: target packet.
IsOverDueCheck if target InworldPacket is earlier than this IndexQueue.InworldPacket: target packet.
AddAdd an InworldPacket into this IndexQueue.InworldPacket: target packet.
ClearClears all the elements inside.
EnqueueCancel this current containable object.
(Usually pour this object to another object)
isHardCancelling: if you also need to clear the content inside.
DequeueDequeue the first added element TneedCallback: if it's true, the T will trigger its OnDequeue
RemoveRemove the exact element T in this IndexQueue.target: the element T to remove.
PourToPour this IndexQueue to another IndexQueue if they are holding the same element T.rhs: The target IndexQueue<T> to pour.