JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
Entity.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Valentin Eloy
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <cstdint>
7
12
13namespace core {
14
24struct Entity {
26 using Index = std::uint32_t;
28 using Generation = std::uint32_t;
29
31 static constexpr Index INVALID_INDEX = ~Index{0};
32
35
37 [[nodiscard]] friend bool operator==(const Entity& lhs, const Entity& rhs) {
38 return lhs.index == rhs.index && lhs.generation == rhs.generation;
39 }
40
41 [[nodiscard]] friend bool operator!=(const Entity& lhs, const Entity& rhs) {
42 return !(lhs == rhs);
43 }
44};
45
48
49} // namespace core
Espace de noms du moteur et de la logique de jeu.
Definition Bootstrap.h:9
constexpr Entity INVALID_ENTITY
Entité invalide conventionnelle : ne désigne jamais une entité vivante.
Definition Entity.h:47
Handle générationnel identifiant une entité de l'ECS.
Definition Entity.h:24
friend bool operator==(const Entity &lhs, const Entity &rhs)
Definition Entity.h:37
static constexpr Index INVALID_INDEX
Valeur d'index réservée pour désigner l'entité invalide.
Definition Entity.h:31
Generation generation
Definition Entity.h:34
friend bool operator!=(const Entity &lhs, const Entity &rhs)
Definition Entity.h:41
std::uint32_t Generation
Type des générations.
Definition Entity.h:28
Index index
Definition Entity.h:33
std::uint32_t Index
Type des index d'entité.
Definition Entity.h:26