return ((FarmScoreContext) featureCtx).getPoints(aiPlayer.getPlayer());
}
}
private double futureConnectionRateConnection(Game game, Location toEmpty, Location toFeature, Position f2Pos, double chance) {
Tile tile1 = game.getCurrentTile();
Tile tile2 = game.getBoard().get(f2Pos);
double rating = 0;
Completable f1 = (Completable) tile1.getFeaturePartOf(toEmpty);
Completable f2 = (Completable) tile2.getFeaturePartOf(toFeature.rev());
if (f1 != null && f2 != null) {
if (f1.getClass().equals(f2.getClass())) {
// System.err.println(" " + tile1.getPosition() + " <-->" + f2Pos + " / " + f1 + " " + f2);
rating += futureConnectionRateFeatures(game, toEmpty, toFeature, chance, f1, f2);
} else {
rating += futureConnectionRateCrossing(game, toEmpty, toFeature, chance, f1, f2);
}
}
if (toEmpty != toFeature) {
boolean left = toEmpty.rotateCCW(Rotation.R90) == toFeature;
Farm farm1 = (Farm) tile2.getFeaturePartOf(left ? toEmpty.getLeftFarm() : toEmpty.getRightFarm());
Farm farm2 = (Farm) tile2.getFeaturePartOf(left ? toFeature.rev().getRightFarm() : toFeature.rev().getLeftFarm());
if (farm1 != null && farm2 != null) {
// System.err.println(" " + tile1.getPosition() + " <-->" + f2Pos + " / " + farm1 + " " + farm2);
rating += futureConnectionRateFeatures(game, toEmpty, toFeature, chance, farm1, farm2);
}