本文整理汇总了C++中MenuManager::GetLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuManager::GetLoggedIn方法的具体用法?C++ MenuManager::GetLoggedIn怎么用?C++ MenuManager::GetLoggedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuManager
的用法示例。
在下文中一共展示了MenuManager::GetLoggedIn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogoutClickListener
//Callback for the LeftClick event listener on the logout button
//param:buttonClicked->Pointer to the button clicked
//param:thisClass->Main menu class, in case we need it
void MainMenu::LogoutClickListener(MenuButton* buttonClicked, void* thisClass)
{
MenuManager* networkManager = MenuManager::GetInstance();
//Make sure we aren't logged in
if(networkManager->GetLoggedIn())
{
//Create a Login Data Gamedata stucture to indicate logout
GameData dataToSend = GameDataBuilder::CreateLoginData(
networkManager->network.GetClientID(), false, (char*)networkManager->GetUsername().c_str(),
"");
//Send the login
networkManager->network.SendData(dataToSend);
}
else
{
std::cout<< "Not Logged In" << std::endl;
}
}
示例2: StatsClickListener
//Callback for the LeftClick event listener on the logout button
//param:buttonClicked->Pointer to the button clicked
//param:thisClass->Main menu class, in case we need it
void MainMenu::StatsClickListener(MenuButton* buttonClicked, void* thisClass)
{
MenuManager* networkManager = MenuManager::GetInstance();
//Make sure we aren't logged in
if(networkManager->GetLoggedIn())
{
//Create a Login Data Gamedata stucture to indicate logout
GameData dataToSend = GameDataBuilder::CreateStatsData(networkManager->network.GetClientID(),
networkManager->GetUsername(), -1, -1, -1);
//Send the login
networkManager->network.SendData(dataToSend);
networkManager->SetScreen(MenuManager::MenuState::STATE_STATS);
}
else
{
std::cout<< "Not Logged In" << std::endl;
}
}