Пример #1
0
        public Planet(ChemicalComposition _chemical, double radius_Km, double distance_from_star)
        {
            this.planetRadius = radius_Km;
            this.planetCore   = new Core();
            this.planetClass  = new PlanetClass("Metallic_Planet");
            body_composition  = _chemical;

            this.name = generate_planet_name();

            this.distance_from_star = distance_from_star;
        }
Пример #2
0
        private void InitPlanetClassification()
        {
            this.planetClass = this.body_composition.GetPlanetClass();

            if (this.Surface_temperature > this.waterBoilingPoint)
            {
                waterState = ElementState.Gas;
            }
            else if (this.Surface_temperature > this.waterMeltingPoint)
            {
                waterState = ElementState.Liquid;
            }
            else
            {
                waterState = ElementState.Solid;
            }
        }
        //imposta la classe del pianeta in base alle percentuali di solidi/ fluidi
        public PlanetClass GetPlanetClass()
        {
            double percRatio = this.get_fluid_elements_percentage() / this.get_solid_elements_percentage();
            string planetClassificationString;

            if (this.get_solid_elements_percentage() > 50.0)
            {
                planetClassificationString = "Metallic_Planet";
            }
            else
            {
                planetClassificationString = "Gasseous_Planet";
            }

            PlanetClass planetClass = new PlanetClass(planetClassificationString);

            return(planetClass);
        }