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


C++ AppDelegate::GetUserGuid方法代码示例

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


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

示例1: touchButton

void GameWin::touchButton(Object* obj,::ui::Widget::TouchEventType eventType)  
{  
    auto button = dynamic_cast<::ui::Button*>(obj);  
    int tag = button->getTag();  
    
	
	auto node =(Node*) this->getChildByTag(CHILD_TURNTABLE);
	if (node != nullptr) {
		return;
	}

	AppDelegate *app = (AppDelegate*)Application::getInstance();

	switch(eventType)  
    {  
	case ::ui::Widget::TouchEventType::ENDED:  

	if (app->getBGMstatus() == BGMusic_flag::ON){
		app->PlayEffect(SOUND_BUTTON_CLICK);

	}
		if(tag==1001){ //Continue

			if(app->GetNetWorkStatus() != NetworkType::NetworkTypeNone){
				std::string sGuid = app->GetUserGuid();
				log("GUID is %s", sGuid.c_str());
				if (sGuid.length() == 0){ // not a registered user
					if (m_iShowRegister == 5){
						MsgBoxType m_type = TP_Q_YESNO;;
						std::string title="Tweebaa";
						std::string msg = MSG_REGISTER_MSG;
						std::string info = "\0";
				
						MsgBox::setMsgBox(m_type, &title, &msg, &info);
						auto msgbox = MsgBox::create();
						auto btnYES = dynamic_cast<Button*>(msgbox->getChildByTag(MSGBOX_UINODE)->getChildByName("btn_Yes"));// Magnifier Button
						btnYES->setTitleFontSize(36);
						btnYES->setTitleText("YES");
						btnYES->addTouchEventListener(CC_CALLBACK_2(GameWin::CallbackRegisterYes, this));
						auto btnNO = dynamic_cast<Button*>(msgbox->getChildByTag(MSGBOX_UINODE)->getChildByName("btn_No"));// Magnifier Button
						btnNO->setTitleText("NOT NOW");
						btnNO->setTitleFontSize(36);
						btnNO->addTouchEventListener(CC_CALLBACK_2(GameWin::CallbackRegisterNo, this));
						msgbox->setTag(MSGBOX_TAG);
						this->addChild(msgbox, 999);
						//m_iShowRegister = 0;
						break;
					}else{
						//m_iShowRegister++;
					}
				}
			}

			if(m_iCurrentGameID == 1){
				auto scene = FindDiffScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else if(m_iCurrentGameID == 2){
				auto scene = ZoomGameScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else if (m_iCurrentGameID == 3){
				auto scene = jigSawScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else if (m_iCurrentGameID == 4){
				auto scene = GameScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else if (m_iCurrentGameID == 5){
				auto scene = PriceMatchScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else if (m_iCurrentGameID == 6){
				auto scene = MultiPriceMatchScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);
			}else{
				auto scene = WelcomeScene::create();
				TransitionScene *transition = TransitionFade::create(1, scene);
				Director::getInstance()->replaceScene(transition);			
			}


			//if(m_iCurrentGameID == 3){
			//	auto scene = jigSawScene::create();
			//	//auto scene = LevelSelectLayer::createScene();
			//	TransitionScene *transition = TransitionFade::create(1, scene);
			//	Director::getInstance()->replaceScene(transition);
			//}
			//if(m_iCurrentGameID == 4){
			//	auto scene = GameScene::create();
			//	//auto scene = LevelSelectLayer::createScene();
			//	TransitionScene *transition = TransitionFade::create(1, scene);
			//	Director::getInstance()->replaceScene(transition);
			//}
			//if(m_iCurrentGameID == 5){
			//	auto scene = PriceMatchScene::create();
			//	//auto scene = LevelSelectLayer::createScene();
			//	TransitionScene *transition = TransitionFade::create(1, scene);
//.........这里部分代码省略.........
开发者ID:zhuanglm,项目名称:TweeBaaMobileApp,代码行数:101,代码来源:GameWinScene.cpp


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