コード例 #1
0
        public void SetSystem(List <Planet> planets)
        {
            if (planets == null || planets[0] == null)
            {
                return;
            }

            var star = planets[0].Star;

            var labels = new List <string>()
            {
                "Star Age:",
                "Star Luminosity:",
                "Star Mass:",
                "Planets:"
            };

            var values = new List <string>()
            {
                StarText.GetAgeStringYearsSciN(star),
                StarText.GetLuminosityPercent(star),
                StarText.GetMassPercent(star),
                planets.Count.ToString()
            };

            SetText(labels, values);
        }
コード例 #2
0
        public static string GetSystemText(List <Planet> planets)
        {
            var sb  = new StringBuilder();
            var sun = planets[0].Star;

            sb.AppendLine(StarText.GetFullStarTextRelative(sun, true));
            sb.AppendLine();

            foreach (var p in planets)
            {
                sb.AppendLine(GetPlanetText(p));
                sb.AppendLine();
                sb.AppendLine();
            }
            return(sb.ToString());
        }