PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
Duration.hpp
1#pragma once
2
3namespace PixelBullet
4{
8 class Duration
9 {
10 public:
12 Duration(float seconds = 0.0f);
13
15 operator float() const;
16
18 float AsSeconds() const;
19
21 float AsMilliseconds() const;
22
23 private:
24 float m_Seconds;
25 };
26} // namespace PixelBullet
A lightweight duration class that holds a time span in seconds.
Definition Duration.hpp:9
float AsSeconds() const
Returns the duration in seconds.
Definition Duration.cpp:15
float AsMilliseconds() const
Returns the duration in milliseconds.
Definition Duration.cpp:20
Duration(float seconds=0.0f)
Constructs a duration from seconds.
Definition Duration.cpp:5