示例#1
0
        public static PlaceShipRequest GetLocationFromComputer()
        {
            PlaceShipRequest ShipToPlace = new PlaceShipRequest();

            ShipToPlace.Direction  = getDirection(GetRandom.GetDirection());
            ShipToPlace.Coordinate = new Coordinate(GetRandom.GetLocation(), GetRandom.GetLocation());
            return(ShipToPlace);
        }
示例#2
0
        public static ShipCoordinates GetLocationFromComputer()
        {
            ShipCoordinates ShipToPlace = new ShipCoordinates();

            ShipToPlace.Direction  = getDirection(GetRandom.GetDirection());
            ShipToPlace.Coordinate = new Coordinates(GetRandom.GetLocation(), GetRandom.GetLocation());
            return(ShipToPlace);
        }
示例#3
0
        public static Coordinate GetShotLocationFromComputer(Board victimboard, GameLevel gamelevel)
        {
            if (gamelevel == GameLevel.Hard)
            {
                if (GetRandom.r.Next(1, 100) <= 60)
                {
                    return(GetRightLocationToShot(victimboard));
                }
            }
            if (gamelevel == GameLevel.Medium)
            {
                if (GetRandom.r.Next(1, 100) <= 30)
                {
                    return(GetRightLocationToShot(victimboard));
                }
            }

            return(new Coordinate(GetRandom.GetLocation(), GetRandom.GetLocation()));
        }
示例#4
0
 public static Coordinate GetShotLocationFromComputer(Panel victimboard)
 {
     return(new Coordinate(GetRandom.GetLocation(), GetRandom.GetLocation()));
 }