Auki::ConjureKit::Session
Abstracts the shared state of a ConjureKit multiplayer session.
Public Functions
Name | |
---|---|
bool | AddComponent(EntityComponent component) Adds an EntityComponent to the session. |
bool | DeleteComponent(EntityComponent component) Deletes an EntityComponent from the session. |
IDictionary< uint, EntityComponent > | GetComponents(uint componentTypeId) Gets all EntityComponents of a component type identifier. |
ICollection< EntityComponent > | GetComponentsByEntityId(uint entityId) Gets all EntityComponents for an entity identifier. |
bool | UpdateComponent(EntityComponent component) Tries to update an EntityComponent |
Session(string id, uint participantId, IDictionary< uint, Participant > participants, IDictionary< uint, Entity > entities, IDictionary< uint, Dictionary< uint, EntityComponent >> componentTypeToEntityComponents) | |
List< Entity > | GetParticipantEntities(uint participantId) Gets a list of all Entities that are owned by a specific Participant. |
Participant | GetParticipant(uint participantId) Gets Participant object from a provided Participant identifier. |
Entity | GetEntity(uint entityId) Gets Entity object in the Session for a given Entity identifier. |
override string | ToString() |
Public Properties
Name | |
---|---|
IDictionary< uint, Participant > | Participants Dictionary mapping all SessionParticipant identifiers to their Participant objects. |
IDictionary< uint, Entity > | Entities Dictionary mapping all SessionEntity identifiers to their Entity objects. |
Public Attributes
Name | |
---|---|
string | Id Session identifier. |
uint | ParticipantId Participant identifier for the currently connected user. |
Public Functions Documentation
function AddComponent
bool AddComponent(
EntityComponent component
)
Adds an EntityComponent to the session.
Parameters:
- component EntityComponent
Return: Boolean success
function DeleteComponent
bool DeleteComponent(
EntityComponent component
)
Deletes an EntityComponent from the session.
Parameters:
- component EntityComponent
Return: Boolean success
function GetComponents
IDictionary< uint, EntityComponent > GetComponents(
uint componentTypeId
)
Gets all EntityComponents of a component type identifier.
Parameters:
- componentTypeId Component type identifier
Return: Dictionary of entity identifiers mapped to EntityComponents
function GetComponentsByEntityId
ICollection< EntityComponent > GetComponentsByEntityId(
uint entityId
)
Gets all EntityComponents for an entity identifier.
Parameters:
- entityId Entity identifier
Return: Boolean success
function UpdateComponent
bool UpdateComponent(
EntityComponent component
)
Tries to update an EntityComponent
Parameters:
- component EntityComponent
Return: Boolean success
function Session
Session(
string id,
uint participantId,
IDictionary< uint, Participant > participants,
IDictionary< uint, Entity > entities,
IDictionary< uint, Dictionary< uint, EntityComponent >> componentTypeToEntityComponents
)
function GetParticipantEntities
List< Entity > GetParticipantEntities(
uint participantId
)
Gets a list of all Entities that are owned by a specific Participant.
Parameters:
- participantId Participant identifier
Return: List of Entity objects
function GetParticipant
Participant GetParticipant(
uint participantId
)
Gets Participant object from a provided Participant identifier.
Parameters:
- participantId Participant identifier.
Return: Participant object if such Participant exists in the Session or null if it doesn't
function GetEntity
Entity GetEntity(
uint entityId
)
Gets Entity object in the Session for a given Entity identifier.
Parameters:
- entityId Entity identifier
Return: Entity object if such Entity exists or null if it doesn't
function ToString
override string ToString()
Public Property Documentation
property Participants
IDictionary< uint, Participant > Participants;
Dictionary mapping all SessionParticipant identifiers to their Participant objects.
property Entities
IDictionary< uint, Entity > Entities;
Dictionary mapping all SessionEntity identifiers to their Entity objects.
Public Attributes Documentation
variable Id
string Id;
Session identifier.
variable ParticipantId
uint ParticipantId;
Participant identifier for the currently connected user.