-
-
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.
Merge pull request #52 from MasterLaplace/47-feature-implement-flakka…
…ri-protocol-v1 Implement flakkari protocol v1
- Loading branch information
Showing
30 changed files
with
1,378 additions
and
924 deletions.
There are no files selected for viewing
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
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
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
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
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
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
52 changes: 52 additions & 0 deletions
52
Flakkari/Engine/EntityComponentSystem/Components/Common/Timer.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,52 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** Title: Flakkari | ||
** Author: MasterLaplace | ||
** Created: 2024-11-17 | ||
** File description: | ||
** Timer | ||
*/ | ||
|
||
#ifndef Timer_HPP_ | ||
#define Timer_HPP_ | ||
|
||
#include <chrono> | ||
#include <cstring> | ||
#include <string> | ||
|
||
#include "config.h.in" | ||
|
||
namespace Flakkari::Engine::ECS::Components::Common { | ||
LPL_PACKED_START | ||
|
||
/** | ||
* @brief Timer component for ECS entities that have a timer attached to them | ||
* | ||
* @details This component is used to store the current time and the maximum time | ||
*/ | ||
struct Timer { | ||
std::chrono::steady_clock::time_point lastTime = std::chrono::steady_clock::now(); | ||
float maxTime; | ||
|
||
Timer() : maxTime(0) {} | ||
Timer(bool spawed) : maxTime(spawed) {} | ||
Timer(const Timer &other) : maxTime(other.maxTime) {} | ||
|
||
Timer &operator=(const Timer &other) | ||
{ | ||
if (this != &other) | ||
{ | ||
lastTime = other.lastTime; | ||
maxTime = other.maxTime; | ||
} | ||
|
||
return *this; | ||
} | ||
|
||
std::size_t size() const { return sizeof(*this); } | ||
}; | ||
|
||
LPL_PACKED_END | ||
} // namespace Flakkari::Engine::ECS::Components::Common | ||
|
||
#endif /* !Timer_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
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
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
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
Oops, something went wrong.