R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Clock.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** Clock.hpp
6*/
7
13#pragma once
14#include <SFML/System/Clock.hpp>
15#include <SFML/System/Time.hpp>
16
17#include "Log.hpp"
18#include "LogMacros.hpp"
19#include "Utilities.hpp"
21
22namespace GUI
23{
24 namespace ECS
25 {
26 namespace Systems
27 {
36 class Clock : public EntityNode {
37 public:
43 Clock(const std::uint32_t entityId = 0);
47 ~Clock();
53 const std::int64_t reset();
59 const std::int64_t getElapsedTime() const;
63 void stop();
67 void start();
73 const bool isRunning() const;
83 const std::string getInfo(const unsigned int indent = 0) const;
84
85 private:
86 bool _isRunning;
87 sf::Clock _clock;
88 };
89
98 std::ostream &operator<<(std::ostream &os, const Clock &item);
99 }
100 }
101}
102
103
This is the file that links the EntityNode children.
Macro definitions for logging messages with varying levels of detail and formatting.
This is the file in charge of containing the Log class (the one in charge of outputing info only when...
A class for managing time tracking within the ECS system.
Definition Clock.hpp:36
const std::int64_t getElapsedTime() const
Gets the elapsed time since the clock was last reset.
Definition Clock.cpp:36
void stop()
Stops the clock.
Definition Clock.cpp:47
const std::string getInfo(const unsigned int indent=0) const
This is a function meant for debugging purposes It will dump the current state of the variables upon ...
Definition Clock.cpp:59
const bool isRunning() const
Checks if the clock is currently running.
Definition Clock.cpp:53
Clock(const std::uint32_t entityId=0)
Construct a new Clock object.
Definition Clock.cpp:16
const std::int64_t reset()
Resets the clock and returns the elapsed time since the last reset.
Definition Clock.cpp:25
~Clock()
Destroy the Clock object.
Definition Clock.cpp:23
void start()
Starts the clock.
Definition Clock.cpp:41
std::ostream & operator<<(std::ostream &os, const Clock &item)
Outputs the clock's info to a stream.
Definition Clock.cpp:73