117 return !this.IsNight;
127 return this.hour >= 19 || this.hour <= 5;
133 public PeriodOfDay periodOfDay
137 if (this.hour >= 5 && this.hour <= 6)
139 return PeriodOfDay.Dawn;
141 if (this.hour >= 7 && this.hour <= 17)
143 return PeriodOfDay.Day;
145 if (this.hour >= 18 && this.hour <= 19)
147 return PeriodOfDay.Dusk;
149 return PeriodOfDay.Night;
155 public string NameMonth
159 return this.month.ToString() ??
"";
165 public string NameMonthShort
169 return this.month.ToString() ??
"";
175 public string NameTime
179 return this.periodOfDay.ToString().lang();
184 public override string ToString()
186 return this.GetText(
Date.TextFormat.Log);
195 return this.month >= 3 && this.month <= 5;
205 return this.month >= 6 && this.month <= 8;
215 return this.month >= 9 && this.month <= 11;
225 return this.month >= 12 || this.month <= 2;
230 public void AddHour(
int a)
233 while (this.hour >= 24)
241 public void AddDay(
int a)
244 while (this.day > 30)
252 public void AddMonth(
int a)
255 while (this.month > 12)
258 int year = this.year;
259 this.year = year + 1;
264 public string GetText(
Date.TextFormat format)
268 case Date.TextFormat.Log:
269 return string.Concat(
new string[]
271 this.month.ToString(),
275 this.hour.ToString(),
279 case Date.TextFormat.Widget:
280 return "dateYearMonthDay".lang(this.year.ToString() ??
"",
this.month.ToString() ??
"",
this.day.ToString() ??
"",
null,
null);
281 case Date.TextFormat.Schedule:
282 return "dateSchedule".lang(this.NameMonth, this.day.ToString() ??
"",
null,
null,
null);
283 case Date.TextFormat.Travel:
285 string str =
"_short";
286 if (format ==
Date.TextFormat.Travel)
288 return "travelDate".lang(this.year.ToString() ??
"",
this.month.ToString() ??
"",
this.day.ToString() ??
"",
null,
null);
293 str2 = str2 + this.day.ToString() + Lang.Get(
"wDay" + str);
297 str2 = str2 + this.hour.ToString() + Lang.Get(
"wHour" + str);
301 str2 = str2 + this.min.ToString() + Lang.Get(
"wMin" + str);
303 return str2 + this.sec.ToString() + Lang.Get(
"wSec" + str);
305 case Date.TextFormat.YearMonthDay:
306 return "dateYearMonthDay".lang(this.year.ToString() ??
"",
this.month.ToString() ??
"",
this.day.ToString() ??
"",
null,
null);
307 case Date.TextFormat.LogPlusYear:
308 return string.Concat(
new string[]
310 this.year.ToString(),
312 this.month.ToString(),
316 this.hour.ToString(),
321 return string.Concat(
new string[]
326 this.hour.ToString(),
334 public static string GetText(
int raw,
Date.TextFormat format)
336 return Date.ToDate(raw).GetText(format);
340 public static string GetText(
int hour)
344 return "dateDayVoid".lang();
348 return "dateDay".lang((hour / 24).ToString() ??
"",
null,
null,
null,
null);
350 return "dateHour".lang(hour.ToString() ??
"",
null,
null,
null,
null);
354 public static string GetText2(
int hour)
362 return (hour / 24).ToString() +
"d";
364 return hour.ToString() +
"h";
368 public int GetRawReal(
int offsetHours = 0)
370 return this.min + (this.hour + offsetHours) * 60 + this.day * 1440 + this.month * 46080 + this.year * 552960;
374 public int GetRaw(
int offsetHours = 0)
376 return this.min + (this.hour + offsetHours) * 60 + this.day * 1440 + this.month * 43200 + this.year * 518400;
380 public int GetRawDay()
382 return this.day * 1440 + this.month * 43200 + this.year * 518400;
386 public bool IsExpired(
int time)
388 return time - this.GetRaw(0) < 0;
392 public int GetRemainingHours(
int rawDeadLine)
394 return (rawDeadLine - this.GetRaw(0)) / 60;
398 public int GetRemainingSecs(
int rawDeadLine)
400 return rawDeadLine - this.GetRaw(0);
404 public int GetElapsedMins(
int rawDate)
406 return this.GetRaw(0) - rawDate;
410 public int GetElapsedHour(
int rawDate)
414 return (this.GetRaw(0) - rawDate) / 60;
420 public static string SecToDate(
int sec)
422 return string.Concat(
new string[]
424 (sec / 60 / 60).ToString(),
426 (sec / 60 % 60).ToString(),
428 (sec % 60).ToString(),
434 public static string MinToDayAndHour(
int min)
440 return min.ToString() +
"分";
444 return num2.ToString() +
"日と" + (num % 24).ToString() +
"時間";
446 return num.ToString() +
"時間";
450 public static int[] GetDateArray(
int raw)
457 raw / 60 / 24 / 30 % 12,
458 raw / 60 / 24 / 30 / 12
463 public static Date ToDate(
int raw)
465 int[] dateArray =
Date.GetDateArray(raw);
466 int num = dateArray[4];
467 int num2 = dateArray[3];
468 int num3 = dateArray[2];
495 public const int ShippingHour = 5;
499 public int[] raw =
new int[6];
502 public const int HourToken = 60;
505 public const int DayToken = 1440;
508 public const int MonthToken = 43200;
511 public const int YearToken = 518400;
514 public const int HourTokenReal = 60;
517 public const int DayTokenReal = 1440;
520 public const int MonthTokenReal = 46080;
523 public const int YearTokenReal = 552960;
526 public enum TextFormat