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); }
/// <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)); }
public void PlayerMove(MoveDirectionCommand command) { var initialStamina = game.Digger.Stamina; game.Player.Send(command); game.Digger.Stamina .Should() .BeLessThan(initialStamina); }
public void Send(MoveDirectionCommand directionCommand) { log.Verbose("{actor} direct to {moveDirectionCommand}", "Player", directionCommand.Direction); MoveCommand(this, directionCommand); }