Beispiel #1
0
 private void CheckIsWon(BeforeActionResult actionResult)
 {
     if (actionResult.IsGameWone)
     {
         this._isGameOn    = false;
         this._isPlayerWon = true;
     }
 }
Beispiel #2
0
        private void UpdateCurrentPlayerPosition(BeforeActionResult actionResult)
        {
            if (!actionResult.IsCanMove)
            {
                return;
            }

            switch (actionResult.Action)
            {
            case ActionType.MoveUp:
                this.Zone.RegisterMovement(
                    this.Player.Position,
                    new Position
                {
                    Row    = this.Player.Position.Row - 1,
                    Column = this.Player.Position.Column
                },
                    this._displayer.Display);
                break;

            case ActionType.MoveRight:
                this.Zone.RegisterMovement(this.Player.Position, new Position
                {
                    Row    = this.Player.Position.Row,
                    Column = this.Player.Position.Column + 1
                },
                                           this._displayer.Display);
                break;

            case ActionType.MoveDown:
                this.Zone.RegisterMovement(this.Player.Position, new Position
                {
                    Row    = this.Player.Position.Row + 1,
                    Column = this.Player.Position.Column
                },
                                           this._displayer.Display);
                break;

            case ActionType.MoveLeft:
                this.Zone.RegisterMovement(this.Player.Position, new Position
                {
                    Row    = this.Player.Position.Row,
                    Column = this.Player.Position.Column - 1
                },
                                           this._displayer.Display);
                break;
            }
        }
Beispiel #3
0
        private void UpdateCurrentPayerHP(BeforeActionResult actionResult)
        {
            if (!actionResult.IsDamaged)
            {
                return;
            }

            this.Player.HP -= actionResult.Damage;

            if (Player.HP < 1)
            {
                this._isGameOn    = false;
                this._isPlayerWon = false;
            }
            this._displayer.DisplayHP(this.Player.HP);
        }