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


C++ Pokemon::getName方法代码示例

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


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

示例1: addText

void Battle::addText(Pokemon a_user, Move a_move) {
	D3DXCOLOR tempcolor = D3DXCOLOR(0.0f,0.0f,0.0f,1.0f);
	swprintf_s(charactertempthingy[curtextincrement], a_user.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// User's name
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 300;
	battletext[curtextincrement].rec.right = 500;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"used");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// Used
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 425;
	battletext[curtextincrement].rec.right = 625;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], a_move.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// User's move's name
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 575;
	battletext[curtextincrement].rec.right = 775;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
}
开发者ID:Ishoa,项目名称:EeveeHound2.0,代码行数:27,代码来源:Battle.cpp

示例2: displayArr

void displayArr(Pokemon arr[], int numGenPokemon, int genNum) {
	Pokemon tempPoke;
	int nameLength = 0;
	string tempName;

	for (int i = 0; i < numGenPokemon; i++) {
		tempPoke = arr[i];

		if(genNum == 0 && i % 10 == 0) cout << endl << endl;	//National Dex line breaks
		else if (genNum != 0 && i % 6 == 0) cout << endl << endl; // All other region line breaks

		if(tempPoke.getRevealed())
			tempName = tempPoke.getName();
		else
			tempName = tempPoke.getID();

		printSpace(MAX_SPACE);
    	nameLength = tempName.size();
    	cout << tempName;

        while(nameLength < MAX_SPACE){
            printSpace(1);
            nameLength++;
        }
	}
}
开发者ID:davemachado,项目名称:Pokemon-Quiz,代码行数:26,代码来源:main.cpp

示例3: round

std::vector<std::string> AttackAction::execute() {
    Pokemon *defendingPokemon = defendingTrainer->getActivePokemon();

    // float effectiveness = 1;
    float effectiveness = Effectiveness::attackingxDefendingChart[attack->getType()][defendingPokemon->getType()]
                          *Effectiveness::attackingxDefendingChart[attack->getType()][defendingPokemon->getType2()];
    float damage = attack->getBaseDamage() * effectiveness;
    int newHp = round(defendingPokemon->getCurrentHp() - damage);

    std::string attackingPokemonName = attackingPokemon->getName();
    std::string defendingPokemonName = defendingPokemon->getName();
    std::ostringstream damageAmount;


    //retVal.push_back(attackingPokemonName + " dealt " + damageAmount.str() + " damage to " + defendingPokemonName);

    retVal.push_back(attackingPokemonName + " used " + attack->getName());

    if (effectiveness == 0) {
        retVal.push_back("It's ineffective...");
    } else if (effectiveness == 0.5 || effectiveness == 0.25) {
        retVal.push_back("It's not very effective...");
    } else if (effectiveness == 2 || effectiveness == 4) {
        retVal.push_back("It's super effective!");
    }


    if(newHp < 0) {
        newHp = 0;
        defendingPokemon->setCurrentHp(newHp);
        retVal.push_back(defendingPokemonName + " died!");
    }

    defendingPokemon->setCurrentHp(newHp);
    attack->setCurrentPp(attack->getCurrentPp()-1);
    damageAmount << attack->getBaseDamage();


    return retVal;
}
开发者ID:stevengt,项目名称:Pokemon-Battle-Simulator,代码行数:40,代码来源:AttackAction.cpp

示例4: addText

void Battle::addText(Pokemon a_user, Move a_move) {
	D3DXCOLOR tempcolor = D3DXCOLOR(0.0f,0.0f,0.0f,1.0f);
	battletext[curtextincrement].text = a_user.getName();// User's name
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 300;
	battletext[curtextincrement].rec.right = 500;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = L"used";// Used
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 425;
	battletext[curtextincrement].rec.right = 625;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = a_move.getName();// User's move's name
	battletext[curtextincrement].rec.top = 375;
	battletext[curtextincrement].rec.bottom = 450;
	battletext[curtextincrement].rec.left = 575;
	battletext[curtextincrement].rec.right = 775;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
}
开发者ID:Ishoa,项目名称:EeveeHound,代码行数:24,代码来源:Battle.cpp

示例5: menuReset

void Battle::menuReset(Pokemon a_pikachu, Pokemon a_enemy) {
	battlemenu.battleReset();
	//wchar_t tempwchar_t[256];
	D3DXCOLOR tempcolor = D3DXCOLOR(0.0f,0.0f,0.0f,1.0f);
	curtextincrement = 0;
	swprintf_s(charactertempthingy[curtextincrement], a_pikachu.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// Pikachu's name
	battletext[curtextincrement].rec.top = 450;
	battletext[curtextincrement].rec.bottom = 525;
	battletext[curtextincrement].rec.left = 600;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"hp:");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's hp:
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 490;
	battletext[curtextincrement].rec.right = 720;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getCurHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // Pikachu's curhp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 555;
	battletext[curtextincrement].rec.right = 750;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"/");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's slash
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 610;
	battletext[curtextincrement].rec.right = 780;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getMaxHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // pikach's max hp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 660;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	//  enemy start
	swprintf_s(charactertempthingy[curtextincrement], a_enemy.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// Enemy's name
	battletext[curtextincrement].rec.top = 75;
	battletext[curtextincrement].rec.bottom = 0;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 200;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"hp:");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's hp:
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 100;
	battletext[curtextincrement].textColor = tempcolor;	
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_enemy.getCurHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // enemy's curhp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 160;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"/");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's slash
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_enemy.getMaxHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // enemy's max hp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 60;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
}
开发者ID:Ishoa,项目名称:EeveeHound2.0,代码行数:82,代码来源:Battle.cpp

示例6: menuResetWithMoves

void Battle::menuResetWithMoves(Pokemon a_pikachu, Pokemon a_enemy) {
	battlemenu.battleResetWithMoves(a_pikachu);
	D3DXCOLOR tempcolor = D3DXCOLOR(0.0f,0.0f,0.0f,1.0f);
	curtextincrement = 0;
	swprintf_s(charactertempthingy[curtextincrement], a_pikachu.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// Pikachu's name
	battletext[curtextincrement].rec.top = 450;
	battletext[curtextincrement].rec.bottom = 525;
	battletext[curtextincrement].rec.left = 600;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"hp:");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's hp:
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 490;
	battletext[curtextincrement].rec.right = 720;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getCurHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // Pikachu's curhp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 555;
	battletext[curtextincrement].rec.right = 750;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"/");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's slash
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 610;
	battletext[curtextincrement].rec.right = 780;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getMaxHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // pikach's max hp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 660;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	//  enemy start
	swprintf_s(charactertempthingy[curtextincrement], a_enemy.getName());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement];// Enemy's name
	battletext[curtextincrement].rec.top = 75;
	battletext[curtextincrement].rec.bottom = 0;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 200;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"hp:");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's hp:
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 100;
	battletext[curtextincrement].textColor = tempcolor;	
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_enemy.getCurHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // enemy's curhp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 160;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"/");
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // hp's slash
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_enemy.getMaxHP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // enemy's max hp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 60;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	// Start move pp's
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getMove(0).getCurPP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // pikachu's 1st move's curpp
	battletext[curtextincrement].rec.top = 480;
	battletext[curtextincrement].rec.bottom = 525;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 160;
	++curtextincrement;
	swprintf_s(charactertempthingy[curtextincrement], L"/");
	battletext[curtextincrement].text = L"/"; // pikachu's 1st move's slash
	battletext[curtextincrement].rec.top = 480;
	battletext[curtextincrement].rec.bottom = 525;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 210;
	++curtextincrement;
	
	swprintf_s(charactertempthingy[curtextincrement], L"%d", a_pikachu.getMove(0).getMaxPP());
	battletext[curtextincrement].text = charactertempthingy[curtextincrement]; // pikachu's 1st move's maxpp
	battletext[curtextincrement].rec.top = 480;
	battletext[curtextincrement].rec.bottom = 525;
//.........这里部分代码省略.........
开发者ID:Ishoa,项目名称:EeveeHound2.0,代码行数:101,代码来源:Battle.cpp

示例7: menuReset

void Battle::menuReset(Pokemon a_pikachu, Pokemon a_enemy) {
	battlemenu.battleReset();
	//wchar_t tempwchar_t[256];
	D3DXCOLOR tempcolor = D3DXCOLOR(0.0f,0.0f,0.0f,1.0f);
	curtextincrement = 0;
	battletext[curtextincrement].text = a_pikachu.getName();// Pikachu's name
	battletext[curtextincrement].rec.top = 450;
	battletext[curtextincrement].rec.bottom = 525;
	battletext[curtextincrement].rec.left = 600;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	battletext[curtextincrement].text = L"hp:"; // hp's hp:
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 490;
	battletext[curtextincrement].rec.right = 720;
	++curtextincrement;
	battletext[curtextincrement].text = terribleJankyIntToLPCWSTR(a_pikachu.getCurHP()); // Pikachu's curhp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 555;
	battletext[curtextincrement].rec.right = 750;
	++curtextincrement;
	battletext[curtextincrement].text = L"/"; // hp's slash
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 610;
	battletext[curtextincrement].rec.right = 780;
	++curtextincrement;
	battletext[curtextincrement].text = terribleJankyIntToLPCWSTR(a_pikachu.getMaxHP()); // pikach's max hp
	battletext[curtextincrement].rec.top = 525;
	battletext[curtextincrement].rec.bottom = 600;
	battletext[curtextincrement].rec.left = 660;
	battletext[curtextincrement].rec.right = 800;
	++curtextincrement;
	//  enemy start
	battletext[curtextincrement].text = a_enemy.getName();// Enemy's name
	battletext[curtextincrement].rec.top = 75;
	battletext[curtextincrement].rec.bottom = 0;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 200;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = L"hp:"; // hp's hp:
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 0;
	battletext[curtextincrement].rec.right = 100;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = terribleJankyIntToLPCWSTR(a_enemy.getCurHP()); // enemy's curhp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 160;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = L"/"; // hp's slash
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 10;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
	battletext[curtextincrement].text = terribleJankyIntToLPCWSTR(a_enemy.getMaxHP()); // enemy's max hp
	battletext[curtextincrement].rec.top = 150;
	battletext[curtextincrement].rec.bottom = 75;
	battletext[curtextincrement].rec.left = 60;
	battletext[curtextincrement].rec.right = 210;
	battletext[curtextincrement].textColor = tempcolor;
	++curtextincrement;
}
开发者ID:Ishoa,项目名称:EeveeHound,代码行数:72,代码来源:Battle.cpp


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