Loading

Paste #p71e4pnrl

  1. uint16 _slowD;       ///< factor of slowing game down , 1 is normal speed
  2. uint64 _dateS;
  3. uint16 _dayn;       ///< factor of slowing game down , 1 is normal speed
  4. Date      _date;       ///< Current date in days (day counter)
  5. unsigned char _yearn ;       ///< regular game year
  6. unsigned char _monthn;       ///< regular game month
  7. unsigned char _monthh;       ///< regular game month  
  8. unsigned char _dayh;       ///< counter for game month  
  9. unsigned char _daym ;       ///< days in month
  10. DateFract _date_fract; ///< Fractional part of the day.
  11. uint16 _tick_counter;  ///< Ever incrementing (and sometimes wrapping) tick counter for setting off various events
  12.  
  13. /**
  14.  * Set the date.
  15.  * @param date  New date
  16.  * @param fract The number of ticks that have passed on this date.
  17.  */
  18. void SetDate(Date date, DateFract fract)
  19. {
  20.     assert(fract < DAY_TICKS);
  21.  
  22.     YearMonthDay ymd;
  23.  
  24.     _date = date;
  25.     _date_fract = fract;
  26.     ConvertDateToYMD(date, &ymd);
  27.     _cur_year = ymd.year;
  28.     _cur_month = ymd.month;
  29.     _dayh = ymd.day; /// does this gives the day of  month we are in???
  30.  
  31.  
  32.  
  33.  
  34. }
  35. void SetSlowTime()
  36. {
  37.     _leap4 = _cur_year % 4;
  38.     _leap100 = _cur_year % 100;
  39.     _leap400 = _cur_year % 400;
  40.     _yearn = 0;
  41.     _monthn = 0;
  42.     _dayn = 0;
  43.     _monthh=_cur_month;
  44.     _dateS = _date*100;
  45.     }

Comments