public PlanetProfile(Random r, WorldFrequency freq) { this.r = r; int val = r.Next(10, 60); val = val + (int)freq; Name = string.Empty; if (val >= 40) { GenerateProfile(); hasPlanet = true; } }
public void CreateGrid(WorldFrequency freq) { HexGrid.Children.Clear(); _profiles.Clear(); _lastUsed = freq; int columns = 10; int rows = 8; Random r = new Random(); for (int x = 0; x < columns; x++) { for (int y = 0; y < rows; y++) { PlanetProfile p = new PlanetProfile(r, freq); p.Column = x; p.Row = y; AddPlanetToGrid(p, HexGrid); } } }