CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::NetworkSystem Class Referencefinal

#include <CeresEngine/Network/NetworkSystem.hpp>

Inheritance diagram for CeresEngine::NetworkSystem:
CeresEngine::System< NetworkSystem, EntityObjectSet<>, ComponentSet< NetworkEntityComponent >, EntityActionSet< TransferAuthority, HasAuthorityQuery > >

Public Member Functions

 NetworkSystem ()
 Creates a new NetworkSystem instance.
 
 NetworkSystem (const NetworkSystem &)=delete
 
NetworkSystemoperator= (const NetworkSystem &)=delete
 
 ~NetworkSystem () override
 Destroys the NetworkSystem instance.
 
void update (double time) final
 Updates the system.
 
template<typename A >
void addNetworkAction ()
 Adds a new NetworkAction to be handled by the network system.
 
template<typename A >
void removeNetworkAction ()
 Removes a previously registered NetworkAction.
 
template<typename A , typename... Args>
NetworkAction< A >::ReturnType remoteAct (Entity &entity, Args &&... args)
 
Async< AnyremoteAct (const Entity &entity, const AbstractNetworkAction &action)
 Executes a remote action on the given entity.
 

Protected Member Functions

void act (Entity &entity, const TransferAuthority &action) final
 
bool act (Entity &entity, const HasAuthorityQuery &action) final
 

Private Attributes

Vector< UPtr< CeresEngine::AbstractActionHandler > > networkActionHandlers
 A vector of the attached network action handlers.
 

Friends

template<typename A >
class NetworkActionHandler
 

Constructor & Destructor Documentation

◆ NetworkSystem() [1/2]

CeresEngine::NetworkSystem::NetworkSystem ( )

Creates a new NetworkSystem instance.

◆ NetworkSystem() [2/2]

CeresEngine::NetworkSystem::NetworkSystem ( const NetworkSystem )
delete

◆ ~NetworkSystem()

CeresEngine::NetworkSystem::~NetworkSystem ( )
override

Destroys the NetworkSystem instance.

Member Function Documentation

◆ act() [1/2]

bool CeresEngine::NetworkSystem::act ( Entity entity,
const HasAuthorityQuery action 
)
finalprotected

◆ act() [2/2]

void CeresEngine::NetworkSystem::act ( Entity entity,
const TransferAuthority action 
)
finalprotected

◆ addNetworkAction()

template<typename A >
void CeresEngine::NetworkSystem::addNetworkAction ( )

Adds a new NetworkAction to be handled by the network system.

All registered actions can be called remotely over the network on the server.

By default, no further action is required to add a network action. If the action requires special treatment, special template- specialization hooks can be provided to customize the behavior.

Template Parameters
Athe action to be made available over the network

◆ operator=()

NetworkSystem & CeresEngine::NetworkSystem::operator= ( const NetworkSystem )
delete

◆ remoteAct() [1/2]

Async< Any > CeresEngine::NetworkSystem::remoteAct ( const Entity entity,
const AbstractNetworkAction action 
)

Executes a remote action on the given entity.

Parameters
entityThe entity to perform the action on
actionThe action to be performed on the entity
Returns
A continuable object containing the result from the action

◆ remoteAct() [2/2]

template<typename A , typename... Args>
NetworkAction< A >::ReturnType CeresEngine::NetworkSystem::remoteAct ( Entity entity,
Args &&...  args 
)

◆ removeNetworkAction()

template<typename A >
void CeresEngine::NetworkSystem::removeNetworkAction ( )

Removes a previously registered NetworkAction.

After removing the action, it will no longer be available for remote invocation over the network.

Template Parameters
Athe action to be revoke availability over the network

◆ update()

void CeresEngine::NetworkSystem::update ( double  time)
final

Updates the system.

Parameters
timeThe amount of time elapsed since the last update

Friends And Related Symbol Documentation

◆ NetworkActionHandler

Member Data Documentation

◆ networkActionHandlers

Vector<UPtr<CeresEngine::AbstractActionHandler> > CeresEngine::NetworkSystem::networkActionHandlers
private

A vector of the attached network action handlers.


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