/// <summary> /// Konumlanma koordinatlarının platoya göre kontrolü /// </summary> /// <param name="plateau"></param> /// <param name="deploymentPoint"></param> private void CheckDeploymentPoint(PlateauModel plateau, DeploymentPointModel deploymentPoint) { if (plateau.Width < deploymentPoint.X || plateau.Height < deploymentPoint.Y || deploymentPoint.X < 0 || deploymentPoint.Y < 0) { throw new OutOfBoundsFromPlateauException("Rover can't located on plateau."); } }
/// <summary> /// Gezicinin plato üzerine konumlanmasını sağlar. /// </summary> /// <param name="plateau"></param> /// <param name="deploymentPoint"></param> /// <returns></returns> public RoverModel SetRoverOnPlateau(PlateauModel plateau, DeploymentPointModel deploymentPoint) { CheckDeploymentPoint(plateau, deploymentPoint); CheckDirection(deploymentPoint.Direction); return(new RoverModel() { DeploymentPoint = deploymentPoint }); }