当前位置: 首页>>代码示例>>C++>>正文


C++ Planet::atmosphere方法代码示例

本文整理汇总了C++中Planet::atmosphere方法的典型用法代码示例。如果您正苦于以下问题:C++ Planet::atmosphere方法的具体用法?C++ Planet::atmosphere怎么用?C++ Planet::atmosphere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Planet的用法示例。


在下文中一共展示了Planet::atmosphere方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setPlanetTypeOuter

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;
    }
}
开发者ID:maxlambertini,项目名称:Warp2010,代码行数:59,代码来源:solarsystemcreator.cpp

示例2: setPlanetTypeInner

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;

    }
}
开发者ID:maxlambertini,项目名称:Warp2010,代码行数:55,代码来源:solarsystemcreator.cpp

示例3: setPlanetTypeLifeZone

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;
    }
}
开发者ID:maxlambertini,项目名称:Warp2010,代码行数:97,代码来源:solarsystemcreator.cpp


注:本文中的Planet::atmosphere方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。