-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Common): Add Id.hpp to Engine/EntityComponentSystem/Components/C…
…ommon directory
- Loading branch information
1 parent
5ce90dd
commit 8b00eeb
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
Flakkari/Engine/EntityComponentSystem/Components/Common/Id.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Title: Flakkari | ||
** Author: MasterLaplace | ||
** Created: 2023-01-06 | ||
** File description: | ||
** Id | ||
*/ | ||
|
||
#ifndef ID_HPP_ | ||
#define ID_HPP_ | ||
|
||
#include <cstdint> | ||
|
||
#include "Network/Packed.hpp" | ||
|
||
namespace Engine::ECS::Components::Common { | ||
PACKED_START | ||
|
||
struct Id { | ||
std::size_t id; | ||
|
||
Id() : id(0) {} | ||
Id(const Id &other) : id(other.id) {} | ||
Id(std::size_t id) : id(id) {} | ||
|
||
std::size_t size() const { | ||
return sizeof(id); | ||
} | ||
}; | ||
|
||
PACKED_END | ||
} // namespace Engine::ECS::Components::Common | ||
|
||
#endif /* !ID_HPP_ */ |