public static List <HexPos> RootNeighboursAtMeristemDistance(HexCubMap map, int requiredDist) { List <HexPos> meristems = GetMeristems(map).ToList(); List <HexPos> valid = new List <HexPos>(); foreach (HexPos free in map.FreePositions()) { if (BordersRoot(free, map) && minDistance(free, meristems) >= requiredDist) { valid.Add(free); } } return(valid); }
protected List <HexPos> PermissableHexPositions( HexCubMap map, int maxDistance, System.Func <HexPos, HexPos, HexCubMap, bool> evalFunc) { HexPos[] free = (HexPos[])map.FreePositions(); HexPos[] occupied = (HexPos[])map.OccupiedPositions(); List <HexPos> permissable = new List <HexPos> (); for (int i = 0; i < free.Length; i++) { for (int j = 0; j < occupied.Length; i++) { if (evalFunc(free [i], occupied [j], map)) { permissable.Add(free [i]); break; } } } return(permissable); }