コード例 #1
0
        public void TestPointFormatWithOffset(int year, int month, int day, long offset, TimeFormat format,
                                              string expectedOutput)
        {
            var calendar = StandardCalendar.Create(year, month, day, 1);

            Assert.AreEqual(expectedOutput, calendar.FormatTime(new TimePoint(offset), format));
        }
コード例 #2
0
        public void StartGame()
        {
            if (IsGameStarted)
            {
                return;
            }

            AppModel.GameData = new GameData(StandardCalendar.Create(2050, 1, 1, Constants.TicksPerDay));
            m_gameServices.Processor.RegisterGameData(AppModel.GameData);
            m_gameServices.Processor.ProcessingStopped += OnProcessingStopped;

            InitializeEntities();

            UpdateCurrentDate();
            UpdateShipOrders();

            IsGameStarted = true;
        }
コード例 #3
0
 public static int GetWeekOfYear(this DateTime t)
 {
     return(StandardCalendar.GetWeekOfYear(t, StandardWeekRule, StandardFirstDayOfWeek));
 }
コード例 #4
0
        public void TestOffsetFormat(long offset, TimeFormat format, string expectedOutput)
        {
            var calendar = StandardCalendar.Create(2000, 1, 1, 1);

            Assert.AreEqual(expectedOutput, calendar.FormatOffset(new TimeOffset(offset), format));
        }