Exemplo n.º 1
0
 public static void BoatFound(Point pointFound,Cell cellFound)
 {
     if (locatedBoats.Count(x => x.cellPoint.BoatType == cellFound.BoatType) == 0)
         locatedBoats.Add(new BoatFinder(pointFound, cellFound));
     else
         locatedBoats.Where(x => x.cellPoint.BoatType == cellFound.BoatType).First().PointFound(pointFound,cellFound);
 }
Exemplo n.º 2
0
 public static void BoatSunk(Cell cellSunk)
 {
     BoatFinder bf = locatedBoats.Where(x => x.cellPoint.BoatType == cellSunk.BoatType).First();
     bf.PointsSunk();
     locatedBoats.Remove(bf);
     boatsSunk.Add(cellSunk.BoatType);
     //locatedBoats.Remove();
 }
Exemplo n.º 3
0
 public static void BoatNotFound(Cell cellFound)
 {
     if (locatedBoats.Count > 0){
         locatedBoats[0].PointNotFound();
     }
 }
Exemplo n.º 4
0
 public BoatFinder(Point initialPoint, Cell cellFound)
 {
     this.initialPoint = initialPoint;
     this.cellPoint = cellFound;
     foundPoints.Add(initialPoint);
 }
Exemplo n.º 5
0
 public void PointFound(Point pointFound, Cell cellFound)
 {
     if (!directionFound) directionFound = true;
     foundPoints.Add(pointFound);
 }