本文整理汇总了C++中Human::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Human::GetName方法的具体用法?C++ Human::GetName怎么用?C++ Human::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Human
的用法示例。
在下文中一共展示了Human::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Human human1 = Human();
Human human2 = Human("Athinodoros", "Fafoutis", 26);
Human maxHuman = Max(human1, human2);
cout << maxHuman.GetName() << " " << maxHuman.GetSurname();
system("PAUSE");
return 0;
}
示例2: HumanStats
/*******************************************************************************************************
* HUMAN STATS - returns the vital statistics for the human player
*******************************************************************************************************/
void HumanStats(Human & HumanObj)
{
std::cout << "\n *------------------------------------------------------------*" << std::endl;
std::cout << " | Status for the human named * " << HumanObj.GetName() << " *" << std::endl;
std::cout << " *------------------------------------------------------------*" << std::endl;
std::cout << " | - Health: " << HumanObj.GetHealth() << std::endl;
std::cout << " | - Strength: " << HumanObj.GetStrength() << std::endl;
std::cout << " | - Luck: " << HumanObj.GetLuck() << std::endl;
std::cout << " | - Intelligence: " << HumanObj.GetIntelligence() << std::endl;
std::cout << " *------------------------------------------------------------*" << std::endl;
}
示例3: Execute
uint CGMyEquipHandler::Execute( CGMyEquip* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
Assert( pGamePlayer ) ;
Human* pHuman = pGamePlayer->GetHuman() ;
Assert( pHuman ) ;
Scene* pScene = pHuman->getScene() ;
Assert( pScene ) ;
//检查线程执行资源是否正确
Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;
ObjID_t ObjID = pHuman->GetID() ;
if( ObjID != pPacket->getObjID() )
{
Assert(FALSE) ;
return PACKET_EXE_ERROR ;
}
GCMyEquip Msg ;
Msg.setObjID( ObjID ) ;
Msg.setName( pHuman->GetName() ) ;
Msg.setDirectory( pHuman->getDir() ) ;
//其他信息设置
pGamePlayer->SendPacket( &Msg ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "CGMyEquipHandler::ObjID=%d\r\n", ObjID ) ;
return PACKET_EXE_CONTINUE ;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR ;
}