summaryrefslogtreecommitdiffstats
path: root/DDate.vala
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-06-03 02:57:19 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-06-03 02:57:19 +0200
commit39e513b0f0d03e0886ef2f201fc3d9e1e6186f8b (patch)
tree3ac1584af061f9f8bf489a9ebc7ead51678d2cbc /DDate.vala
parent0230508fb3cc88a8801a35d4b13947bcd10c86ae (diff)
downloaddclock-39e513b0f0d03e0886ef2f201fc3d9e1e6186f8b.tar
dclock-39e513b0f0d03e0886ef2f201fc3d9e1e6186f8b.zip
Fixed intentation
Diffstat (limited to 'DDate.vala')
-rw-r--r--DDate.vala176
1 files changed, 88 insertions, 88 deletions
diff --git a/DDate.vala b/DDate.vala
index 54c1064..b29944d 100644
--- a/DDate.vala
+++ b/DDate.vala
@@ -1,98 +1,98 @@
using GLib;
public enum DDateMonth {
- CHAOS = 0, DISCORD = 1, CONFUSION = 2, BUREAUCRACY = 3, THE_AFTERMATH = 4, ST_TIBS_DAY;
-
- public string to_short_string() {
- switch(this) {
- case CHAOS:
- return "Chs";
- case DISCORD:
- return "Dsc";
- case CONFUSION:
- return "Cfn";
- case BUREAUCRACY:
- return "Bcy";
- case THE_AFTERMATH:
- return "Afm";
- default:
- return "St. Tib's Day";
- }
- }
+ CHAOS = 0, DISCORD = 1, CONFUSION = 2, BUREAUCRACY = 3, THE_AFTERMATH = 4, ST_TIBS_DAY;
+
+ public string to_short_string() {
+ switch(this) {
+ case CHAOS:
+ return "Chs";
+ case DISCORD:
+ return "Dsc";
+ case CONFUSION:
+ return "Cfn";
+ case BUREAUCRACY:
+ return "Bcy";
+ case THE_AFTERMATH:
+ return "Afm";
+ default:
+ return "St. Tib's Day";
+ }
+ }
}
public enum DDateWeekday {
- SWEETMORN = 0, BOOMTIME = 1, PUNGENDAY = 2, PRICKLE_PRICKLE = 3, SETTING_ORANGE = 4, ST_TIBS_DAY;
-
- public string to_short_string() {
- switch(this) {
- case SWEETMORN:
- return "SM";
- case BOOMTIME:
- return "BT";
- case PUNGENDAY:
- return "PD";
- case PRICKLE_PRICKLE:
- return "PP";
- case SETTING_ORANGE:
- return "SO";
- default:
- return "St. Tib's Day";
- }
- }
+ SWEETMORN = 0, BOOMTIME = 1, PUNGENDAY = 2, PRICKLE_PRICKLE = 3, SETTING_ORANGE = 4, ST_TIBS_DAY;
+
+ public string to_short_string() {
+ switch(this) {
+ case SWEETMORN:
+ return "SM";
+ case BOOMTIME:
+ return "BT";
+ case PUNGENDAY:
+ return "PD";
+ case PRICKLE_PRICKLE:
+ return "PP";
+ case SETTING_ORANGE:
+ return "SO";
+ default:
+ return "St. Tib's Day";
+ }
+ }
}
public struct DDate {
- private GLib.Date date;
-
- private uint get_day_of_year() {
- if (date.get_year().is_leap_year() && date.get_day_of_year() > 60)
- return date.get_day_of_year()-1;
- else
- return date.get_day_of_year();
- }
-
- public DDate(GLib.Date date0) {
- date = date0;
- }
-
- public DDate.with_time_t(time_t time) {
- date = Date();
- date.set_time_t(time);
- }
-
- public bool is_st_tibs_day() {
- return (date.get_month() == GLib.DateMonth.FEBRUARY && date.get_day() == 29);
- }
-
- public uchar get_day() {
- return (uchar)(get_day_of_year() % 73);
- }
-
- public DDateMonth get_month() {
- if(is_st_tibs_day())
- return DDateMonth.ST_TIBS_DAY;
-
- return (DDateMonth)(get_day_of_year()/73);
- }
-
- public DDateWeekday get_weekday() {
- if(is_st_tibs_day())
- return DDateWeekday.ST_TIBS_DAY;
-
- return (DDateWeekday)((get_day_of_year()-1)%5);
- }
-
- public string to_string() {
- string ret = "";
-
- if(is_st_tibs_day()) {
- ret = "St. Tib's Day";
- }
- else {
- ret = get_weekday().to_short_string() + ", " + get_day().to_string() + ". " + get_month().to_short_string();
- }
-
- return ret;
- }
+ private GLib.Date date;
+
+ private uint get_day_of_year() {
+ if (date.get_year().is_leap_year() && date.get_day_of_year() > 60)
+ return date.get_day_of_year()-1;
+ else
+ return date.get_day_of_year();
+ }
+
+ public DDate(GLib.Date date0) {
+ date = date0;
+ }
+
+ public DDate.with_time_t(time_t time) {
+ date = Date();
+ date.set_time_t(time);
+ }
+
+ public bool is_st_tibs_day() {
+ return (date.get_month() == GLib.DateMonth.FEBRUARY && date.get_day() == 29);
+ }
+
+ public uchar get_day() {
+ return (uchar)(get_day_of_year() % 73);
+ }
+
+ public DDateMonth get_month() {
+ if(is_st_tibs_day())
+ return DDateMonth.ST_TIBS_DAY;
+
+ return (DDateMonth)(get_day_of_year()/73);
+ }
+
+ public DDateWeekday get_weekday() {
+ if(is_st_tibs_day())
+ return DDateWeekday.ST_TIBS_DAY;
+
+ return (DDateWeekday)((get_day_of_year()-1)%5);
+ }
+
+ public string to_string() {
+ string ret = "";
+
+ if(is_st_tibs_day()) {
+ ret = "St. Tib's Day";
+ }
+ else {
+ ret = get_weekday().to_short_string() + ", " + get_day().to_string() + ". " + get_month().to_short_string();
+ }
+
+ return ret;
+ }
}