private void expandRecursiveByAP(int dist, int AP, int maxAP, Surroundings surroundings, bool isUndeadHorse = false) { if (AP > maxAP) { return; } if (!surroundings.addOrUpdateTerrainForSmallerValues(this, x, y, dist, AP)) { return; } if (creature != null && dist != 0 && !isUndeadHorse) { return; } for (int aux = 0; aux < this.neighboursCount; aux++) { if (this.neighbours[aux].movePointsRequired != -1 || isUndeadHorse) { neighbours[aux].expandRecursiveByAP( dist + 1, AP + (movePointsRequired == -1? 1 : movePointsRequired), maxAP, surroundings, dist == 0 && creature is UndeadKnight? true: isUndeadHorse ); } } }
private void expandRecursiveByDistance(int dist, int AP, int maxDist, Surroundings surroundings) { if (dist > maxDist) { return; } if (!surroundings.addOrUpdateTerrainForSmallerValues(this, x, y, dist, AP)) { return; } for (int aux = 0; aux < this.neighboursCount; aux++) { if (this.neighbours[aux].movePointsRequired != -1) { neighbours[aux].expandRecursiveByDistance( dist + 1, AP + movePointsRequired, maxDist, surroundings ); } } }