CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
NetworkEvent.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
11
12namespace CeresEngine {
13
16 virtual ~AbstractNetworkEvent() = default;
17 };
18
22 template<typename E> struct NetworkEvent : public AbstractNetworkEvent, public EntityEvent<NetworkEvent<E>> {};
23
26 template<typename A> constexpr bool isNetworkEvent = std::is_base_of<AbstractNetworkEvent, A>::value;
27
30 template<typename... As> constexpr bool areNetworkEvents = (isNetworkEvent<As> && ...);
31
32} // namespace CeresEngine
Definition Application.hpp:19
constexpr bool isNetworkEvent
A trait that checks if the type A is a network event.
Definition NetworkEvent.hpp:26
constexpr bool areNetworkEvents
A trait that checks if the types As are all events.
Definition NetworkEvent.hpp:30
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition NetworkEvent.hpp:14
virtual ~AbstractNetworkEvent()=default
Destroys the AbstractNetworkEvent instance.
A template class that wraps a event.
Definition Event.hpp:43
The NetworkEvent is a special type of event that can be sent over the network.
Definition NetworkEvent.hpp:22