35 public EntityAction<NetworkAction<A>, std::conditional_t<std::is_same_v<typename A::ReturnType, void>, Async<>, Async<typename A::ReturnType>>> {
47 template<
typename... Args>
explicit NetworkAction(Args&&... args);
59 template<
typename A>
constexpr bool isNetworkAction = std::is_base_of<AbstractNetworkAction, A>::value;
70 if constexpr(std::is_same_v<ReturnValueType, void>) {
71 entity.
act<
A>(action);
74 return entity.
act<
A>(action);
The base entity class.
Definition Entity.hpp:41
decltype(auto) act(Args &&... args) const
Orders the entity to act on the action A.
Definition Application.hpp:19
constexpr bool areNetworkActions
A trait that checks if the types As are all actions.
Definition NetworkAction.hpp:63
constexpr bool isNetworkAction
A trait that checks if the type A is a network action.
Definition NetworkAction.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition NetworkAction.hpp:20
virtual ~AbstractNetworkAction()=default
Destroys the AbstractNetworkAction instance.
virtual Any dispatchAny(Entity entity) const =0
Dispatches the action to the given entity.
A class that must be inherited by concrete action types.
Definition Action.hpp:33
The NetworkAction is a special type of action that can be performed remotely on the server.
Definition NetworkAction.hpp:35
ReturnValueType dispatch(Entity entity) const
Dispatches the action to the given entity.
Definition NetworkAction.hpp:78
A action
The wrapped action type.
Definition NetworkAction.hpp:41
typename A::ReturnType ReturnValueType
The type that must be returned by action handlers.
Definition NetworkAction.hpp:37
NetworkAction(Args &&... args)
Creates a new NetworkAction.
Definition NetworkAction.hpp:67
Any dispatchAny(Entity entity) const final
Dispatches the action to the given entity.
Definition NetworkAction.hpp:69