void CheckMostDesirableNeighbor() { int dValue = 0; for (HexDirection i = HexDirection.NE; i <= HexDirection.NW; i++) { if (currentCell.GetNeighbor(i)) { if (currentCell.GetEdgeType(i) != HexEdgeType.Slope) { HexCell dCell = currentCell.GetNeighbor(i); if (dCell.Desirability(desirabilityFactors) > dValue) { dValue = dCell.Desirability(desirabilityFactors); } } } } //Do stuff }