private void GenerateRegions(int number) { for (int i = 0; i < number; i++) { PlanetRegion r = new PlanetRegion(this); Regions.Add(r); RegionToPlanet.Add(r, this); } }
public List <PlanetRegion> GetNeighbouringRegions(PlanetRegion start) { List <PlanetRegion> valid = new List <PlanetRegion> (); int i = Regions.IndexOf(start); if (!(i - 1 < 0)) { valid.Add(Regions[i - 1]); } if (i + 1 < Regions.Count) { valid.Add(Regions[i + 1]); } return(valid); }