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); }
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(); }
public static void BoatNotFound(Cell cellFound) { if (locatedBoats.Count > 0){ locatedBoats[0].PointNotFound(); } }
public BoatFinder(Point initialPoint, Cell cellFound) { this.initialPoint = initialPoint; this.cellPoint = cellFound; foundPoints.Add(initialPoint); }
public void PointFound(Point pointFound, Cell cellFound) { if (!directionFound) directionFound = true; foundPoints.Add(pointFound); }