OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
timestamp.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWWORLD_TIMESTAMP_H
2 #define GAME_MWWORLD_TIMESTAMP_H
3 
4 namespace ESM
5 {
6  struct TimeStamp;
7 }
8 
9 namespace MWWorld
10 {
14  class TimeStamp
15  {
16  float mHour;
17  int mDay;
18 
19  public:
20 
21  explicit TimeStamp (float hour = 0, int day = 0);
24 
25  explicit TimeStamp (const ESM::TimeStamp& esm);
26  ESM::TimeStamp toEsm () const;
27 
28  float getHour() const;
29 
30  int getDay() const;
31 
32  TimeStamp& operator+= (double hours);
34  };
35 
36  bool operator== (const TimeStamp& left, const TimeStamp& right);
37  bool operator!= (const TimeStamp& left, const TimeStamp& right);
38 
39  bool operator< (const TimeStamp& left, const TimeStamp& right);
40  bool operator<= (const TimeStamp& left, const TimeStamp& right);
41 
42  bool operator> (const TimeStamp& left, const TimeStamp& right);
43  bool operator>= (const TimeStamp& left, const TimeStamp& right);
44 
45  TimeStamp operator+ (const TimeStamp& stamp, double hours);
46  TimeStamp operator+ (double hours, const TimeStamp& stamp);
47 
48  double operator- (const TimeStamp& left, const TimeStamp& right);
50 }
51 
52 #endif
Definition: defs.hpp:11
bool operator==(const LiveCellRef< X > &ref, int pRefnum)
Definition: cellstore.cpp:205
float mHour
Definition: timestamp.hpp:16
int getDay() const
Definition: timestamp.cpp:22
ESM::TimeStamp toEsm() const
Definition: timestamp.cpp:109
TimeStamp & operator+=(double hours)
Definition: timestamp.cpp:27
int mDay
Definition: timestamp.hpp:17
TimeStamp operator+(const TimeStamp &stamp, double hours)
Definition: timestamp.cpp:77
float getHour() const
Definition: timestamp.cpp:17
bool operator<=(const Ptr &left, const Ptr &right)
Definition: ptr.hpp:194
In-game time stamp.
Definition: timestamp.hpp:14
bool operator>(const Ptr &left, const Ptr &right)
Definition: ptr.hpp:189
bool operator<(const Ptr &left, const Ptr &right)
Definition: ptr.hpp:179
double operator-(const TimeStamp &left, const TimeStamp &right)
Returns the difference between left and right in in-game hours.
Definition: timestamp.cpp:87
bool operator!=(const CellStore &left, const CellStore &right)
Definition: cellstore.cpp:935
bool operator>=(const Ptr &left, const Ptr &right)
Definition: ptr.hpp:184
TimeStamp(float hour=0, int day=0)
Definition: timestamp.cpp:10