Class SequenceSystem
Defined in File SequenceSystem.h
Inheritance Relationships
Base Type
public csp::systems::SystemBase
(Class SystemBase)
Class Documentation
-
class SequenceSystem : public csp::systems::SystemBase
Public facing system that allows the management of groupings of items in a space.
Public Types
-
typedef std::function<void(const csp::multiplayer::SequenceChangedParams&)> SequenceChangedCallbackHandler
Public Functions
-
void CreateSequence(const csp::common::String &SequenceKey, const csp::common::String &ReferenceType, const csp::common::String &ReferenceId, const csp::common::Array<csp::common::String> &Items, const csp::common::Map<csp::common::String, csp::common::String> &MetaData, SequenceResultCallback Callback)
Creates a new sequence.
If a sequence already exists with this key, it will overwrite the current one.
Note
This call will fail (Reason InvalidSequenceKey) if the SequenceKey parameter contains invalid keys, such as spaces, ‘/’ or ‘’ This call will fail if the user isn’t a creator of the space.
- Parameters
SequenceKey – csp::common::String : The unique grouping name. Our naming convention is: Type:[SpaceId]:[GroupName]
ReferenceType – csp::common::String : The type of reference (GroupId etc.)
ReferenceId – csp::common::String : The id of the reference
Items – csp::common::Array<csp::common::String> : An ordered array of members
MetaData – csp::common::Map<csp::common::String, csp::common::String> : Any additional data relating to the Sequence
Callback – SequenceResultCallback : callback to call when a response is received
-
void UpdateSequence(const csp::common::String &SequenceKey, const csp::common::String &ReferenceType, const csp::common::String &ReferenceId, const csp::common::Array<csp::common::String> &Items, const csp::common::Map<csp::common::String, csp::common::String> &MetaData, SequenceResultCallback Callback)
Updates an existing sequence.
This call will fail if the user isn’t a creator of the space.
Note
This call will fail if the SequenceKey parameter contains invalid keys, such as spaces, ‘/’ or ‘’
- Parameters
SequenceKey – csp::common::String : The unique grouping name. Our naming convention is: Type:[SpaceId]:[GroupName]
ReferenceType – csp::common::String : The type of reference (GroupId etc.)
ReferenceId – csp::common::String : The id of the reference
Items – csp::common::Array<csp::common::String> : An ordered array of members
MetaData – csp::common::Map<csp::common::String, csp::common::String> : Any additional data relating to the Sequence
Callback – SequenceResultCallback : callback to call when a response is received
-
void RenameSequence(const csp::common::String &OldSequenceKey, const csp::common::String &NewSequenceKey, SequenceResultCallback Callback)
Renames a given sequence.
This call will fail if the user isn’t a creator of the space.
Note
This call will fail (Reason InvalidSequenceKey) if the OldSequenceKey, or NewSequenceKey parameters contains invalid keys, such as spaces, ‘/’ or ‘’
- Parameters
OldSequenceKey – csp::common::String : The current sequence key name
NewSequenceKey – csp::common::String : The new sequence key name
Callback – SequenceResultCallback : callback to call when a response is received
-
void GetSequencesByCriteria(const csp::common::Array<csp::common::String> &SequenceKeys, const csp::common::Optional<csp::common::String> &KeyRegex, const csp::common::Optional<csp::common::String> &ReferenceType, const csp::common::Array<csp::common::String> &ReferenceIds, const csp::common::Map<csp::common::String, csp::common::String> &MetaData, SequencesResultCallback Callback)
Finds sequences based on the given criteria.
Note
This call will fail (Reason InvalidSequenceKey) if the SequenceKey parameter contains invalid keys, such as spaces, ‘/’ or ‘’
- Parameters
SequenceKeys – csp::common::Array<csp::common::String> : An array of sequence keys to search for
SequenceKeys – csp::common::Optional<csp::common::String> : An optional regex string for searching keys
ReferenceType – csp::common::String : The type of reference (GroupId etc.). Must be used with ReferenceIds
ReferenceIds – csp::common::Array<csp::common::String> : The ids of the reference. Must be used with ReferenceType
MetaData – csp::common::Map<csp::common::String, csp::common::String> : Any additional data relating to the Sequence
Callback – SequencesResultCallback : callback to call when a response is received
-
void GetAllSequencesContainingItems(const csp::common::Array<csp::common::String> &Items, const csp::common::Optional<csp::common::String> &ReferenceType, const csp::common::Array<csp::common::String> &ReferenceIds, SequencesResultCallback Callback)
Finds all sequences that contain the given items.
- Parameters
Items – csp::common::Array<csp::common::String> : An array of items which should be searched for
ReferenceType – csp::common::String : The type of reference (GroupId etc.). Must be used with ReferenceIds
ReferenceIds – csp::common::Array<csp::common::String> : The ids of the reference. Must be used with ReferenceType
Callback – SequencesResultCallback : callback to call when a response is received
-
void GetSequence(const csp::common::String &SequenceKey, SequenceResultCallback Callback)
Gets a sequence by it’s key.
Note
This call will fail (Reason InvalidSequenceKey) if the SequenceKey parameter contains invalid keys, such as spaces, ‘/’ or ‘’
- Parameters
SequenceKey – csp::common::String : The unique grouping name
Callback – SequenceResultCallback : callback to call when a response is received
-
void DeleteSequences(const csp::common::Array<csp::common::String> &SequenceKeys, NullResultCallback Callback)
Deletes the given sequences.
This call will fail if the user isn’t a creator of the space
Note
This call will fail (Reason InvalidSequenceKey) if the SequenceKey parameter contains invalid keys, such as spaces, ‘/’ or ‘’
- Parameters
SequenceKeys – csp::common::Array<csp::common::String> : An array of sequence keys to delete
Callback – NullResultCallback : callback to call when a response is received
-
void SetSequenceChangedCallback(SequenceChangedCallbackHandler Callback)
Sets a callback for a sequence changed event.
- Parameters
Callback – SequenceChangedCallbackHandler: Callback to receive data for the sequence that has been changed.
-
virtual void RegisterSystemCallback() override
Registers the system to listen for the named event.
-
virtual void DeregisterSystemCallback() override
Deregisters the system from listening for the named event.
-
virtual void OnEvent(const std::vector<signalr::value> &EventValues) override
Deserialises the event values of the system.
- Parameters
EventValues – std::vector<signalr::value> : event values to deserialise
-
typedef std::function<void(const csp::multiplayer::SequenceChangedParams&)> SequenceChangedCallbackHandler