Esempio n. 1
0
        public int MovePlayer(Turn turn, int currentPosition, int totalSquares)
        {
            var moves         = new int[turn.TurnTotal()].ToList();
            var moveDirection = MoveDirection.Forward;
            var newPosition   = currentPosition;

            moves.ForEach(t =>
            {
                if (newPosition == totalSquares)
                {
                    moveDirection = MoveDirection.Backwards;
                }
                if (moveDirection == MoveDirection.Forward)
                {
                    newPosition++;
                }
                else
                {
                    newPosition--;
                }
            });

            return(newPosition);
        }
Esempio n. 2
0
 public void Inject(Board board, IDice dice, Turn turn)
 {
     this.board = board;
     this.dice  = dice;
     this.turn  = turn;
 }