Beispiel #1
0
        //obliczanie ile minut upłyneło od ostatniego update
        public int CalculateNumberOfCycles()
        {
            GameRepository gameRepository      = Context.gameRepository;
            TimeSpan       timeSinceLastUpdate = DateTime.Now.Subtract(Update);
            int            numberOfCycles      = (int)timeSinceLastUpdate.TotalMinutes;

            Update = Update.AddMinutes(numberOfCycles);
            gameRepository.Save();
            return(numberOfCycles);
        }