BalloonsPop.Core.Commands.GameOverHandlingCommand.Execute C# (CSharp) Метод

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

Executes GameOverHandlingCommand
public Execute ( IContext context ) : void
context IContext
Результат void
        public override void Execute(IContext context)
        {
            if (context.LogicProvider.GameIsOver(context.Game.Field))
            {
                context.Message = "Gratz, completed in " + context.Game.UserMovesCount + " moves.";
                this.SubCommands.Add(new PrintMessageCommand());
                if (context.HighscoreTable.CanAddPlayer(context.Game.UserMovesCount))
                {
                    this.SubCommands.Add(new AddPlayerscoreCommand());
                    this.SubCommands.Add(new PrintHighscoreCommand());
                }

                this.SubCommands.Add(new PlaySoundCommand("win"));
                this.SubCommands.Add(new CompositeRestart());

                base.Execute(context);

                this.SubCommands.Clear();
            }
        }
GameOverHandlingCommand