Esempio n. 1
0
        public bool AllowMovementFrom(MoveDirectionCommand command)
        {
            var resolution = GetCurrentTile().MoveFromInto(command.Direction);

            log.Verbose("{actor} {movement} from {tileCoordinate}", "Digger", resolution ? "ready to move" : "stay", DiggerPosition);
            return(resolution);
        }
Esempio n. 2
0
        /// <summary>
        ///     Get next active tile and pass it to Digger, to detect what can be done with that tile
        /// </summary>
        /// <param name="sender">Player object</param>
        /// <param name="move">Command with proposed direction</param>
        private void PlayerOnMoveCommand(object sender, MoveDirectionCommand move)
        {
            if (!Map.AllowMovementFrom(move))
            {
                return;
            }

            Map.Move(new DiggerMoves(Digger, move.Direction));
        }
Esempio n. 3
0
        public void PlayerMove(MoveDirectionCommand command)
        {
            var initialStamina = game.Digger.Stamina;

            game.Player.Send(command);

            game.Digger.Stamina
            .Should()
            .BeLessThan(initialStamina);
        }
Esempio n. 4
0
 public void Send(MoveDirectionCommand directionCommand)
 {
     log.Verbose("{actor} direct to {moveDirectionCommand}", "Player", directionCommand.Direction);
     MoveCommand(this, directionCommand);
 }