コード例 #1
0
 public CrewPanel()
 {
     string[] headers =
     {
         "Name",
         "Trait",
         "Location",
         "Gender",
         "Age",
         "Childbirth"
     };
     int[] headerWidth =
     {
         130,
         60,
         80,
         60,
         130,
         140
     };
     GUIStyle[] styles =
     {
         RegisterToolbar.DefGuiSkin.label,
         RegisterToolbar.labelCentered,
         RegisterToolbar.DefGuiSkin.label,
         RegisterToolbar.labelCentered,
         RegisterToolbar.DefGuiSkin.label,
         RegisterToolbar.DefGuiSkin.label
     };
     grid = new Grid();
     grid.setHeaders(headers, headerWidth, styles);
     this.formatter = new TimeFormatter();
 }
コード例 #2
0
 public CrewPanel()
 {
     string[] headers =
     {
         "Name",
         "Trait",
         "Location",
         "Gender",
         "Age",
         "Childbirth"
     };
     grid = new Grid();
     grid.setHeaders(headers);
     this.formatter = new TimeFormatter();
 }
コード例 #3
0
 public VesselsPanel()
 {
     this.formatter = new TimeFormatter();
 }
コード例 #4
0
        public void Format_age_for_35_years_and_few_seconds()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("Adult (35 years)", formatter.format(21600 * 426 * 35 + 1, TimeFormat.AGE));
        }
コード例 #5
0
        public void Format_age_for_20_years()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("Young adult (20 years)", formatter.format(21600 * 426 * 20, TimeFormat.AGE));
        }
コード例 #6
0
        public void Format_0_to_0_sec()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("00:00:00", formatter.format(0));
        }
コード例 #7
0
        public void Format_500_days()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("1 year 74 day(s) 00:00:00", formatter.format(10800000));
        }
コード例 #8
0
        public void Format_age_for_100_days()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("Young (100 days)", formatter.format(2160000, TimeFormat.AGE));
        }
コード例 #9
0
        public void Format_time_counting_days()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("37 day(s) 04:03:43", formatter.format(813823));
        }
コード例 #10
0
        public void Format_100_days()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("100 day(s) 00:00:00", formatter.format(2160000));
        }
コード例 #11
0
        public void Format_time_counting_hours()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("04:03:43", formatter.format(14623));
        }
コード例 #12
0
        public void Format_60_into_1_m_0_s()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("00:01:00", formatter.format(60));
        }
コード例 #13
0
        public void Format_double_to_int_sec()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("00:00:02", formatter.format(2.43));
        }
コード例 #14
0
        public void Format_age_for_65_years()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("Ancient (65 years)", formatter.format(21600 * 426 * 65, TimeFormat.AGE));
        }
コード例 #15
0
        public void Format_age_for_50_years()
        {
            TimeFormatter formatter = new TimeFormatter();

            Assert.AreEqual("Senior (50 years)", formatter.format(21600 * 426 * 50, TimeFormat.AGE));
        }