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
Properties | Description |
---|---|
ID | The ID of the conatainable object. |
RecentTime | The recent visit time of the object. |
IsEmpty | Check if the containable object is empty. |
Interface functions
Function | Description | Parameters |
---|---|---|
Contains | Check if it contains the target InworldPacket. | InworldPacket: target packet. |
Add | Add an InworldPacket into the containable object. | InworldPacket: target packet. |
Cancel | Cancel this current containable object. (Usually pour this object to another object) | isHardCancelling: if you also need to clear the content inside. |
OnDequeue | Triggers when this containable object is dequeuing. |
IndexQueue<T>
Module: Inworld.AI. Namespace: Inworld.Interactions. where T: IContainable
Variables
Variables | Description |
---|---|
Elements | The list of the elements of class T. |
Properties
Properties | Description |
---|---|
RecentTime | The recent visit time of the object. |
Count | the count of the elements. |
IsEmpty | Check if the containable object is empty. |
this[index] | It also supports using [] to visit the element T with the exact index. |
API
Function | Description | Parameters |
---|---|---|
Contains | Check if it contains the target InworldPacket. | InworldPacket: target packet. |
IsOverDue | Check if target InworldPacket is earlier than this IndexQueue. | InworldPacket: target packet. |
Add | Add an InworldPacket into this IndexQueue. | InworldPacket: target packet. |
Clear | Clears all the elements inside. | |
Enqueue | Cancel this current containable object. (Usually pour this object to another object) | isHardCancelling: if you also need to clear the content inside. |
Dequeue | Dequeue the first added element T | needCallback: if it's true, the T will trigger its OnDequeue |
Remove | Remove the exact element T in this IndexQueue. | target: the element T to remove. |
PourTo | Pour this IndexQueue to another IndexQueue if they are holding the same element T. | rhs: The target IndexQueue<T> to pour. |