Hummingbird Framework
 All Classes Functions Variables Modules Pages
Time.h
1 #ifndef HB_TIME_H
2 #define HB_TIME_H
3 
4 namespace hb
5 {
13  class Time
14  {
15  public:
19  Time();
23  ~Time();
28  double asSeconds() const;
33  int asMilliseconds() const;
38  long long asMicroseconds() const;
39 
43  static Time seconds(double seconds);
47  static Time milliseconds(int milliseconds);
51  static Time microseconds(long long microseconds);
53  static Time deltaTime;
54 
55  private:
56  long long m_microseconds;
57  };
58 }
59 
60 bool operator ==(hb::Time left, hb::Time right);
61 bool operator !=(hb::Time left, hb::Time right);
62 bool operator <(hb::Time left, hb::Time right);
63 bool operator >(hb::Time left, hb::Time right);
64 bool operator <=(hb::Time left, hb::Time right);
65 bool operator >=(hb::Time left, hb::Time right);
66 hb::Time operator -(hb::Time right);
67 hb::Time operator +(hb::Time left, hb::Time right);
68 hb::Time& operator +=(hb::Time &left, hb::Time right);
69 hb::Time operator -(hb::Time left, hb::Time right);
70 hb::Time& operator -=(hb::Time &left, hb::Time right);
71 hb::Time operator *(hb::Time left, double right);
72 hb::Time operator *(hb::Time left, long long right);
73 hb::Time operator *(double left, hb::Time right);
74 hb::Time operator *(long long left, hb::Time right);
75 hb::Time& operator *=(hb::Time &left, double right);
76 hb::Time& operator *=(hb::Time &left, long long right);
77 hb::Time operator /(hb::Time left, double right);
78 hb::Time operator /(hb::Time left, long long right);
79 hb::Time& operator /=(hb::Time &left, double right);
80 hb::Time& operator /=(hb::Time &left, long long right);
81 double operator /(hb::Time left, hb::Time right);
82 hb::Time operator %(hb::Time left, hb::Time right);
83 hb::Time& operator %=(hb::Time &left, hb::Time right);
84 #endif
Time()
Default constructor.
~Time()
Class destructor.
static Time seconds(double seconds)
Construct Time from seconds.
long long asMicroseconds() const
Get Time as microseconds.
static Time deltaTime
Game delta Time.
Definition: Time.h:53
static Time milliseconds(int milliseconds)
Construct Time from milliseconds.
static Time microseconds(long long microseconds)
Construct Time from microseconds.
Definition: Box2DPlugin.h:6
int asMilliseconds() const
Get Time as milliseconds.
Class for representing intervals of time.
Definition: Time.h:13
double asSeconds() const
Get Time as seconds.