public void RenderConstellation(Constellation Constellation, bool WithCaption) { this.RenderShape(Constellation.Shape, Constellation.FrontPen); QPoint p; if (projector.Project2DPoint(Constellation.PositionSnapshot, true, out p)) { if (WithCaption) { this.DrawStringCentered(Constellation.Name, p, Constellation.CaptionPen, this.SmallItalicFont); } Constellation.RenderPoint = p; RenderLocations[NumRenderLocations++] = Constellation; } }
private void setupConstellations() { string[,] Data = IO.ReadFile(Constellation.CONSTELLATION_DEF_FILENAME, DirectoryLocation.Data); this.Constellations = new List <Constellation>(DEFAULT_STARTING_NUM_CONSTELLATIONS); for (int i = 0; i <= Data.GetUpperBound(0); i++) { int index = Data[i, 0].ParseInt(-1); string name = Data[i, 1]; Constellation c = this.Constellations.FirstOrDefault(cc => cc.Name == name); bool isNew = c == null; if (isNew) { c = new Constellation(name, this); this.Constellations.Add(c); } for (int j = 1; j <= Data.GetUpperBound(1); j++) { if (Data[i, j] == null) { break; } c.WithLines(index, Data[i, j].Trim().Split('-').Select(n => n.ParseInt(0)).ToList()); } } this.Constellations.Sort((a, b) => a.Name.CompareTo(b.Name)); foreach (var c in this.Constellations) { this.registerCelestialBody(c); } }
private void registerCelestialBody(Constellation Constellation) { Constellation.FixConstellationLocation(); registerCelestialBody(Constellation as CelestialBody); }