vegastrike  0.5.1.r1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stardate.h
Go to the documentation of this file.
1 
9 /*
10  * Stardate class
11  * Full date format is days.hours.minutes:seconds
12  * Short date format is days.hours.minutes
13  * Compact date format is days.hours
14  */
15 
16 #ifndef __STARDATE_H
17 #define __STARDATE_H
18 
19 #include <string>
20 using std::string;
21 
22 #define HOURS_DIV 8
23 
24 class StarDate
25 {
26 private:
27  double *initial_star_time;
28  double initial_time;
29 
30 //TREK Date stuff
31  string ConvertTrekDate( double date );
32  double ConvertTrekDate( string date );
33  float GetFloatFromTrekDate( int faction = 0 );
34 
35 public: StarDate();
36  StarDate( double time );
37  void Init( double time );
38  double GetCurrentStarTime( int faction = 0 );
39  double GetElapsedStarTime(int faction = 0);
40 
41 //TREK Date stuff
42  void InitTrek( string date );
43  string GetTrekDate( int faction = 0 );
44  string GetFullTrekDate( int faction = 0 );
45  string ConvertFullTrekDate( double date );
46 
47 //DAN.A StarDate
48  void InitSDate( string date );
49  string GetSDate( int faction = 0 );
50  string GetFullSDate( int faction = 0 );
51 
52 //Between date format conversion
53  string SDateFromTrekDate( string trekdate );
54  string TrekDateFromSDate( string sdate );
55 };
56 
57 #endif
58