ArmedCards.BusinessLogic.AppServices.GameRound.Start.Execute C# (CSharp) Метод

Execute() публичный Метод

Starts a round if certain requirements are met
public Execute ( Entities game, Entities commander ) : System.Boolean
game Entities The game to start a new round for
commander Entities The new round's commander
Результат System.Boolean
        public Boolean Execute(Entities.Game game, Entities.User commander)
        {
            Boolean started = _startRound.Execute(game, commander);

            if (started && game.SecondsToPlay > 0)
            {
                String jobId = BackgroundJob.Schedule<AppServices.GameRound.Base.ITimerExpired>(x => x.Execute(game.GameID), TimeSpan.FromSeconds(15 + game.SecondsToPlay));

                MemoryCache.Default.Set(game.RoundTimerKey, jobId, new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(5) });
            }

            _updateGame.Execute(game.GameID, DateTime.UtcNow, null);

            return started;
        }