Emergency 2017 Dokumentation  v3.0.1
qsf::logic::SequenceManager Class Reference

Sequence manager class. More...

#include <SequenceManager.h>

Public Types

typedef std::vector< Sequence * > SequenceVector
 

Public Member Functions

SequencecreateNewSequenceById (uint64 id)
 Create a new and empty sequence instance. More...
 
bool destroySequenceById (uint64 id)
 Destroy a sequence instance by using its ID. More...
 
void destroyAllSequences ()
 Destroy all sequences within this sequence system. More...
 
bool changeSequenceId (uint64 oldId, uint64 newId)
 Change a sequences ID. More...
 
SequencegetSequenceById (uint64 id) const
 Return a sequence instance by using its local asset ID. More...
 
const SequenceVectorgetSequences () const
 Return the list of currently instanced sequences. More...
 
std::string generateUnusedSequenceName (const std::string &firstPart)
 Return a sequence name that is not used by another sequence. More...
 
SequencegetSequenceByLocalAssetId (const StringHash &stringHash, bool load=true)
 Return a sequence instance by using its local asset ID. More...
 

Friends

class SequenceSystem
 

Additional Inherited Members

- Protected Member Functions inherited from qsf::Manager
 Manager ()
 Default constructor. More...
 
virtual ~Manager ()
 Destructor. More...
 

Detailed Description

Sequence manager class.

Remarks
In order to create sequences via code write
qsf::logic::Sequence* sequence = QSF_LOGIC_SEQUENCE.createNewSequenceByLocalAssetId("sample/sequence/cutscene/intro");
// ... sequence null pointer check would be a good idea ...
uint64 newSequenceId = sequence->getId(); // "qsf::getUninitialized<uint64>()" if invalid sequence ID

The following example shows how to get the instance of a certain sequence:

// uint64 mySequenceId = ...
qsf::logic::Sequence* sequence = QSF_LOGIC_SEQUENCE.getSequenceByLocalAssetId(mySequenceId);

Use "qsf::logic::SequencePlayer" for sequence playback.

Todo:
  • TODO(co) As far as I can tell at the moment, there's no need for a sequence manager because the sequence system could also do this job

Definition at line 72 of file SequenceManager.h.

Member Typedef Documentation

Definition at line 86 of file SequenceManager.h.

Member Function Documentation

bool qsf::logic::SequenceManager::changeSequenceId ( uint64  oldId,
uint64  newId 
)

Change a sequences ID.

Note
  • Use with care: all references to the old sequence ID will become invalid
Sequence* qsf::logic::SequenceManager::createNewSequenceById ( uint64  id)

Create a new and empty sequence instance.

Parameters
[in]idThe ID to assign to the new sequence
Returns
The created sequence instance, null pointer on error (unique sequence identifier already used?), do no destroy the returned instance and do need keep a reference to it outside the C runtime stack (use the unique sequence ID instead)
Note
  • The new sequence instance has no tracks at all
void qsf::logic::SequenceManager::destroyAllSequences ( )

Destroy all sequences within this sequence system.

bool qsf::logic::SequenceManager::destroySequenceById ( uint64  id)

Destroy a sequence instance by using its ID.

Parameters
[in]idThe sequences ID
Returns
"true" if all went fine, else "false" (unknown sequence identifier?)
std::string qsf::logic::SequenceManager::generateUnusedSequenceName ( const std::string &  firstPart)

Return a sequence name that is not used by another sequence.

Parameters
[in]firstPartThe first part of the desired sequence name, it will be expanded by a number
Returns
A free name that can be used for a new sequence
Sequence * qsf::logic::SequenceManager::getSequenceById ( uint64  id) const
inline

Return a sequence instance by using its local asset ID.

Parameters
[in]idThe sequence ID generated by "qsf::StringHash" (example: "sample/sequence/default/intro")
Returns
The requested sequence instance, null pointer on error

Definition at line 16 of file SequenceManager-inl.h.

Sequence* qsf::logic::SequenceManager::getSequenceByLocalAssetId ( const StringHash stringHash,
bool  load = true 
)

Return a sequence instance by using its local asset ID.

Parameters
[in]stringHashThe local sequence asset ID generated by "qsf::StringHash" (example: "sample/sequence/cutscene/intro")
[in]loadIn case the sequence is not loaded, yet, do automatically load it?
Returns
The requested sequence instance, null pointer on error, do not destroy the returned instance
Note
  • In case there's no instance of the given local asset, yet, an instance will be created on-the-fly
const SequenceManager::SequenceVector & qsf::logic::SequenceManager::getSequences ( ) const
inline

Return the list of currently instanced sequences.

Returns
Reference to the internal list of currently instanced sequences, do not manipulate the list or destroy the sequences

Definition at line 23 of file SequenceManager-inl.h.

Friends And Related Function Documentation

friend class SequenceSystem
friend

Definition at line 79 of file SequenceManager.h.


The documentation for this class was generated from the following files: