Example #1
0
        public void Execute()
        {
            if (_freezeTime == default)
            {
                _freezeTime = DateTime.Now.AddSeconds(_seconds);
            }

            if (DateTime.Now < _freezeTime)
            {
                _commandManager.ClearQueue();
                _commandManager.AddCommand(this);
            }
        }
        public void Handle(Trigger trigger, IEntity entity)
        {
            if ((entity is Ball) == false)
            {
                return;
            }

            if (_updateScoreCommand == null)
            {
                var score = (ScoreTextBox)_entityManager.GetEntity(Constants.EntityIds.ScoreId);
                _updateScoreCommand = new UpdateScoreCommand(score)
                {
                    IncrementPlayerScore = false
                };
            }

            _commandManager.ClearQueue();
            _commandManager.AddCommand(_updateScoreCommand);
            _commandManager.AddCommand(_newRoundCommand);
            //_commandManager.AddCommand(new FreezeCommand(1));
        }