void SolarSystemCreator::setPlanetTypeOuter(Planet& planet)
{
    double die = SSGX::d10()+SSGX::d10();
    switch (planet.atmosphere())
    {
        case atVacuum:
            if (SSGX::d10() < 7) setPtIceball(planet); else setPtRockball(planet);
            planet.setHydrosphereType(NSPlanet::htIce);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atVeryThin:
            if (SSGX::d10() < 7) setPtIceball(planet); else setPtRockball(planet);
            planet.setHydrosphereType(NSPlanet::htIce);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atThin:
            if (SSGX::d10() < 7) setPtRockball(planet); else setPtDesert(planet);
            planet.setHydrosphereType(NSPlanet::htIce);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atStandard:
            if (SSGX::d10() < 7) setPtRockball(planet); else setPtDesert(planet);
            planet.setHydrosphereType(NSPlanet::htIce);
            if (die == 2)
                planet.orbit().setShortDay();
            else if (die == 20)
                planet.orbit().setLongDay();
            else
                planet.orbit().setNormalDay();
            break;
        case atDense:
        if (SSGX::d10() < 7) setPtDesert(planet); else setPtFailedCore(planet);
            if (die == 2)
                planet.orbit().setShortDay();
            else if (die == 20)
                planet.orbit().setLongDay();
            else
                planet.orbit().setNormalDay();
            break;
        case atMassive:
            setPtGasGiant(planet);
            break;
    }
}
void SolarSystemCreator::setPlanetTypeInner(Planet& planet)
{
    int die = SSGX::d10()+SSGX::d10();
    int die1 = SSGX::d10()+SSGX::d10();
    switch (planet.atmosphere())
    {
        case atVacuum:
            planet.orbit().setLongDay();
            setPtRockball(planet);
            break;
        case atVeryThin:
            setPtRockball(planet);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atThin:
            setPtDesert(planet);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atStandard:
            if (SSGX::d10() < 7) setPtHotHouse(planet); else setPtRockball(planet);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atDense:
        if (SSGX::d10() < 7) setPtHotHouse(planet); else setPtRockball(planet);
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            if (die1 == 7 && planet.temperature() < 333) {
                setPtPreGarden(planet);
            }
            break;
        case atMassive:
            setPtGasGiant(planet);
            break;

    }
}
void SolarSystemCreator::setPlanetTypeLifeZone(Planet& planet)
{
    double die = SSGX::d10()+SSGX::d10();
    double die1 = SSGX::d10()+SSGX::d10();
    switch (planet.atmosphere())
    {
        case atVacuum:
            planet.setPlanetType(ptRockball);
            planet.setHydrosphereType(NSPlanet::htIce);
            planet.setWaterPercentage(SSGX::floatRand());
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atVeryThin:
            planet.setPlanetType(ptRockball);
            planet.setHydrosphereType(NSPlanet::htIce);
            planet.setWaterPercentage(SSGX::floatRand());
            if (die == 2)
                planet.orbit().setNormalDay();
            else if (die == 20)
                planet.orbit().setVeryLongDay();
            else
                planet.orbit().setLongDay();
            break;
        case atThin:
            planet.setPlanetType(ptDesert);
            planet.setHydrosphereType(NSPlanet::htIce);
            planet.setWaterPercentage(SSGX::floatRand());
            if (die == 2)
                planet.orbit().setShortDay();
            else if (die == 20)
                planet.orbit().setLongDay();
            else
                planet.orbit().setNormalDay();
            break;
        case atStandard:
            planet.setPlanetType(ptDesert);
            planet.setHydrosphereType(NSPlanet::htIce);
            planet.setWaterPercentage(SSGX::floatRand());
            if (die == 2)
                planet.orbit().setShortDay();
            else if (die == 20)
                planet.orbit().setLongDay();
            else
                planet.orbit().setNormalDay();
            if (die1 == 7)
                planet.setPlanetType(ptPreGarden);
            break;
        case atDense:
            planet.setPlanetType(ptGarden);

            planet.setHydrosphereType(NSPlanet::htLiquid);
            planet.setWaterPercentage(SSGX::dn(90));
            if (die == 2)
                planet.orbit().setShortDay();
            else if (die == 20)
                planet.orbit().setLongDay();
            else
                planet.orbit().setNormalDay();
            if  ( planet.temperature() < 230)
                planet.setPlanetType(ptGlacier);

            switch (_star->starType()) {
            case NSStar::stF:
                die1--;
                break;
            case NSStar::stK:
                die1++;
                break;
            case NSStar::stM:
                die1+=2;
                break;
            default:
                break;
            }

            if (die1 < 3) {
                planet.setPlanetType(ptPreGarden);
                planet.setWaterPercentage(SSGX::dn(20));
            }
            if (die1 > 17) {
                planet.setPlanetType(ptPostGarden);
                planet.setWaterPercentage(SSGX::dn(20));
            }
            break;
        case atMassive:
            planet.setPlanetType(ptGasGiant);
            planet.setHydrosphereType(NSPlanet::htShards);
            planet.setWaterPercentage(SSGX::floatRand());
            planet.orbit().setShortDay();
            break;
    }
}