qb::Main::CoreBuilder Class Reference

Helper to build Actors in VirtualCore. More...

#include <qb/main.h>

Public Types

using ActorIdList = std::vector< ActorId >
 

Public Member Functions

 CoreBuilder (CoreBuilder const &rhs)
 
template<typename _Actor , typename ... _Args>
CoreBuilderaddActor (_Args &&...args)
 Create new _Actor. More...
 
bool valid () const
 
 operator bool () const
 
ActorIdList const & idList () const
 Get list of created ActorId by the CoreBuilder. More...
 

Detailed Description

Helper to build Actors in VirtualCore.

Member Function Documentation

◆ addActor()

template<typename _Actor , typename ... _Args>
CoreBuilder& qb::Main::CoreBuilder::addActor ( _Args &&...  args)

Create new _Actor.

Template Parameters
_ActorDerivedActor type
Parameters
argsarguments to forward to the constructor of the _Actor
Returns
itself

create new _Actor on attached VirtualCore, function can be chained.
example:

auto builder = main.core(0); // get builder of VirtualCore id 0
builder.addActor<MyActor>(param1, param2)
.addActor<MyActor>(param1, param2)
// ...
;
Attention
This function is not available when the engine is running.

◆ idList()

ActorIdList const& qb::Main::CoreBuilder::idList ( ) const

Get list of created ActorId by the CoreBuilder.

Returns
Created ActorId list