• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetGame函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetGame函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGame函数的具体用法?C++ GetGame怎么用?C++ GetGame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: switch

void App::onMenuCommand( WORD id )
{
	switch( id )
	{
	case IDM_EXIT:
		onQuit();
		break;

	case IDM_RELOADSETUP:
		GetGame()->reload_setup();
		break;
	}
}
开发者ID:Caoxuyang,项目名称:klcommon,代码行数:13,代码来源:App.cpp


示例2: GetGame

AFlareAsteroid* UFlareSector::LoadAsteroid(const FFlareAsteroidSave& AsteroidData)
{
    FActorSpawnParameters Params;
    Params.bNoFail = true;
	Params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

	AFlareAsteroid* Asteroid = GetGame()->GetWorld()->SpawnActor<AFlareAsteroid>(AFlareAsteroid::StaticClass(), AsteroidData.Location, AsteroidData.Rotation, Params);
    Asteroid->Load(AsteroidData);

	// TODO Check double add
	SectorAsteroids.Add(Asteroid);
    return Asteroid;
}
开发者ID:Helical-Games,项目名称:HeliumRain,代码行数:13,代码来源:FlareSector.cpp


示例3: Draw

void NLight::Draw(NCamera* View)
{
    //If the light isn't on the current level of the map, don't draw it! This is required because 2d lighting!
    if (GetGame()->GetMap()->GetLevel() != GetGame()->GetMap()->GetLevel(GetRealPos()))
    {
        return;
    }
    //Clear out the stencil buffer with 0's so we have a clean slate to work with.
    glClear(GL_STENCIL_BUFFER_BIT);
    glEnable(GL_STENCIL_TEST);
    //Make it so whatever we draw replaces everything it touches in the stencil to 1.
    glStencilFunc(GL_ALWAYS,0x1,0x1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
    //Draw all our shadow volumes.
    DrawShadow(View);
    //Now we make it so we can only draw on 0's, we also don't want to replace anything in the stencil buffer so we lock it up.
    glStencilFunc(GL_EQUAL,0x0,0x1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
    //Finally draw the light into whatever's not shadow.
    DrawLight(View);
    glDisable(GL_STENCIL_TEST);
}
开发者ID:Tamschi,项目名称:Astrostruct,代码行数:22,代码来源:NLight.cpp


示例4: sizeof

void FactionOper::RecvJoindNotifyMsg(CMessage* pMsg)
{
    // 族员结构
    tagFacMemInfo	stFacMemInfo;
    pMsg->GetEx( &stFacMemInfo, sizeof(stFacMemInfo) );
    CGUID           FactionGuid;
    pMsg->GetGUID( FactionGuid );

    // 添加一个族员
    CFacMember::SMemberInfo	stMemberInfo;
    stMemberInfo.guidFac = FactionGuid;
    stMemberInfo.guidMember = stFacMemInfo.MemberGuid;
    stMemberInfo.strName = stFacMemInfo.szName;
    stMemberInfo.strTitle = stFacMemInfo.szTitle;
    stMemberInfo.lLevel = stFacMemInfo.lLvl;
    stMemberInfo.lJob = stFacMemInfo.lJobLvl;
    stMemberInfo.lOccupation = stFacMemInfo.lOccu;
    stMemberInfo.lContribute = stFacMemInfo.lContribute;
    stMemberInfo.bOnline = stFacMemInfo.bIsOnline != 0;
    stMemberInfo.strRegion = stFacMemInfo.szRegion;

    
    m_pFactionManager->AddMyConfrere( &stMemberInfo );

    // 是否是自己
    if( GetGame()->GetMainPlayer()->GetExID() == stFacMemInfo.MemberGuid )
    {
        GetGame()->GetMainPlayer()->SetFactionID(FactionGuid);

        m_pFactionManager->SetMyJob( stFacMemInfo.lJobLvl );

        // "您已经加入家族: %s"
        TCHAR	szPrompt[ 1024 ];
        wsprintf( szPrompt, AppFrame::GetText("FA_308"), GetGame()->GetMainPlayer()->GetFactionName().c_str() );
        GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt);
    }

    FireUIEvent("FactionPage","UpdateFacAppList");
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:39,代码来源:FactionPageOper.cpp


示例5: GetGame

bool Ghost::IsMobGhost()
{
    static size_t mob_id = 0;
    static bool draw = true;
    if (!GetGame().GetMob())
    {
        return false;
    }
    if (mob_id != GetGame().GetMob().ret_id())
    {
        if (id_ptr_on<Ghost> g = GetGame().GetMob())
        {
            draw = true;
        }
        else
        {
            draw = false;
        }
        mob_id = GetGame().GetMob().ret_id();
    }
    return draw;
}
开发者ID:Chemrat,项目名称:karya-valya,代码行数:22,代码来源:Ghost.cpp


示例6: Execute

	virtual void Execute(const DataObject &)
	{
        // The current player is now in a blocking action.
        RULE.Execute(shRuleBeginBlockingAction, DataObject(current()));

		wxInt32 index = gameData<wxInt32>(shMasterMerchantVictim);
		const wxString& name = playerGame(index).player().Name();

		wxString str = wxString::Format(
			stSelectTwoCardsToStealFrom.c_str(), swStringFormat.c_str(), 
			name.c_str());
		wxString str2 = wxString::Format(
			stWaitingSelectTwoCardsToSteal.c_str(), 
            swStringFormat.c_str(), name.c_str());
		RULE.Execute(shRuleUpdateMessageUI, DataObject(str, str2));

		Controller::get().Transmit(shEventControlsUI, DataObject(false));
		Controller::get().Transmit(shEventBuildUI, 
				DataObject(false, GetGame()));

		Controller::get().Transmit(shEventMasterMerchantResource, GetGame());
	}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:22,代码来源:RuleRestartTurnMasterMerchantSteal.cpp


示例7: msgToWs

//! 发送联系人数据到WS
void LinkmanSystem::SendDataToWs(void)
{
	CMessage msgToWs(MSG_S2W_LINKMAN_DATA);
	vector<BYTE> vLinkmanData;

	//! 先给玩家总数占个位置
	_AddToByteArray(&vLinkmanData, (LONG)0L);

	//! 实际发送人数统计
	LONG lNum = 0;
	map<CGUID, VecLinkmanGroup>::iterator ite = m_mapPlayerLinkman.begin();
	for (; ite != m_mapPlayerLinkman.end(); ++ite)
	{
		if(NULL == GetGame()->FindPlayer(ite->first))
		{
			if(NULL == GetGame()->FindSavePlayer(ite->first))
				continue;
		}

		++lNum;
		//! 玩家GUID
		_AddToByteArray(&vLinkmanData, ite->first);
		VecLinkmanGroup &vLinkmanGroup = ite->second;
		//! 联系人组数
		_AddToByteArray(&vLinkmanData, (LONG)vLinkmanGroup.size());
		for (LONG i = 0; i < (long)vLinkmanGroup.size(); ++i)
		{
			//! 联系人数据
			vLinkmanGroup[i].Serialize_ForWS(&vLinkmanData);
		}
	}

	//! 在编码中替换实际人数
	memcpy(&vLinkmanData[0], &lNum, sizeof(LONG));

	msgToWs.Add((LONG)vLinkmanData.size());
	msgToWs.AddEx(&vLinkmanData[0], (long)vLinkmanData.size());
	msgToWs.Send();
}	
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:40,代码来源:LinkmanSystem.cpp


示例8: glDeleteBuffers

NTextInput::~NTextInput()
{
    glDeleteBuffers(2,Buffers);
    delete[] Buffers;
    if (Texture)
    {
        delete Texture;
    }
    if (HasFocus)
    {
        GetGame()->GetInput()->SetFocus(false);
    }
}
开发者ID:Tamschi,项目名称:Astrostruct,代码行数:13,代码来源:NTextInput.cpp


示例9: GetIntParam

double CScript::GetAttr(const char* CmdStr, char* retStr)
{
	OBJECT_TYPE type;
	CGUID id;
	double value   = 0;

	if(!GetSrcShape()) return -1.0f;

	int param = GetIntParam(CmdStr, 0);
	if(param != ERROR_CODE && param != INVILID_VALUE)
	{
		type = (OBJECT_TYPE)param;

		char* pIdName = GetStringParam(CmdStr, 1);
		if(!pIdName) return -1.0f;

		id = GetScriptGuidValue((CMoveShape*)GetSrcShape(), pIdName);

		char* name = GetStringParam(CmdStr, 2);
		if(!name)
		{
			M_FREE( pIdName, sizeof(char)*MAX_VAR_LEN );
			return -1.0f;
		}

		CMoveShape* shape = NULL;
		if(NULL_GUID == id) // 默认id=0时,直接调用SrcShape的SetAttr接口
		{
			shape = (CMoveShape*)GetSrcShape();
		}
		else
			shape = GetGame()->FindShape(type, id);

		if(shape)
		{
			long lRet = shape->GetAttribute(std::string(name));
			M_FREE( pIdName, sizeof(char)*MAX_VAR_LEN );
			M_FREE( name, sizeof(char)*MAX_VAR_LEN );
			return lRet;
		}
		
		M_FREE( pIdName, sizeof(char)*MAX_VAR_LEN );
		M_FREE( name, sizeof(char)*MAX_VAR_LEN );
	}
	else // 该参数是字符串
	{
		AddErrorLogText(CStringReading::LoadString(IDS_GS_FUNCTION, STR_GS_FUNCTION_SETATTRFIRSTVARISSTRING));
	}

	return 0.0f;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:51,代码来源:MoveShapeFun.cpp


示例10: GetGame

void SaveCommand::Execute()
{
  ofstream saveFile;
  saveFile.open ("save.txt");
  
  saveFile << "#player "<<GetGame()->GetPlayer().GetName() << "\n";
  saveFile << GetGame()->GetPlayer().GetRace() << "\n";
  saveFile << GetGame()->GetPlayer().GetClass() << "\n";
  saveFile << GetGame()->GetPlayer().GetAge() << "\n";
  saveFile << GetGame()->GetPlayer().GetGender() << "\n";
  saveFile << GetGame()->GetPlayer().GetExperience() << "\n";
  saveFile << GetGame()->GetCurrentRoom()->GetID() << "\n";
  saveFile << GetGame()->GetPlayer().pMoney.GetAmount();
  
  //saveFile << enemy.IsAlive() << "\n";
  saveFile.close();
  
  GetGame()->GetRenderer()->Render("Saved\n");
}
开发者ID:VSP,项目名称:Advanced-C--,代码行数:19,代码来源:SaveCommand.cpp


示例11: vector

/*
****Takes the story choice the user made and adjust the game state appropriately.
*/
void ChapterMenu::ProcessChoice(unsigned int key)
{
Tools::Debug::Print("ChapterMenu::ProcessOptionKeyPress() - Story option selected.", Tools::Debug::PRIORITY::MID);
	
	/*	The values to change the player stats are stored in a vector. Since there are two values to retrieve for each choice
		(time lost and rest lost) we need to find which two values in the vector are the ones that correspond with the story 
		choice the user made.
		
		The values are stored sequentially from the results for the first option to the results for the last option. So if
		there are three options for the player to choose from, there are six values in the vector (0-5). These results are
		in pairs of two. The first being time lost and the second being rest lost. For example:
		
		Choosing option 1 would mean the values are at 0 and 1.
		Choosing option 2 would mean the values are at 2 and 3.
		Choosing option 3 would mean the values are at 4 and 5.
		
		I figured out a simple equation that will automatically find the vector index for the first value we need. After
		which we just increment by 1 to get the next value in the pair.
		
		firstValue = (choice - 1) + (choice - 1)
	*/

	// Find the vector indices we need.
	int timeLocation = (key - 1) + (key - 1);
	int restLocation = timeLocation + 1;

	// Grab the values in the vector AT the indices.
	short timeLost = chapter.GetStatChanges().at(timeLocation);
	short restLost = chapter.GetStatChanges().at(restLocation);

	// Subtract those values from the player's stats.
	GetGame().GetDM().RemoveTime(timeLost);
	GetGame().GetDM().RemoveRest(restLost);

	// Check if the game has ended due to stats dropping to zero.
	if (GetGame().GetDM().IsGameOver())
		GetGame().EndGame();
}
开发者ID:Alcanteria,项目名称:CQuest,代码行数:41,代码来源:ChapterMenu.cpp


示例12: CShader

void IRenderSystem::LoadShaders()
{
	if (GetGame()->GetGLSLVersion() >= GetGame()->GetMinGLSLVersion())
	{
		if (GetGame()->GetGLSLVersion() == GLSL_VERSION_330)
		{
			CShader* shader = new CShader("shaders/unlit.vs.glsl", "shaders/unlit.ps.glsl");
			m_Shaders["unlit"] = shader;

			shader = new CShader_GBuffer("shaders/gbuffer.vs.glsl", "shaders/gbuffer.ps.glsl");
			m_Shaders["gbuffer"] = shader;

			shader = new CShader_Deferred("shaders/deferred.vs.glsl", "shaders/deferred.ps.glsl");
			m_Shaders["deferred"] = shader;

			shader = new CShader_SSAO("shaders/ssao.vs.glsl", "shaders/ssao.ps.glsl");
			m_Shaders["ssao"] = shader;

			shader = new CShader_SSAO("shaders/ssao_blur.vs.glsl", "shaders/ssao_blur.ps.glsl");
			m_Shaders["ssao_blur"] = shader;

			m_PPChain.AddShader(m_Shaders["deferred"]);
			m_PPChain.AddShader(m_Shaders["ssao"]);
		}
		else if (GetGame()->GetGLSLVersion() == GLSL_VERSION_130)
		{
			CShader* shader = new CShader("shaders/1_30/unlit.vs.glsl", "shaders/1_30/unlit.ps.glsl");
			m_Shaders["unlit"] = shader;

			shader = new CShader_GBuffer("shaders/1_30/gbuffer.vs.glsl", "shaders/1_30/gbuffer.ps.glsl");
			m_Shaders["gbuffer"] = shader;

			shader = new CShader_Deferred("shaders/1_30/deferred.vs.glsl", "shaders/1_30/deferred.ps.glsl");
			m_Shaders["deferred"] = shader;

			shader = new CShader_SSAO("shaders/1_30/ssao.vs.glsl", "shaders/1_30/ssao.ps.glsl");
			m_Shaders["ssao"] = shader;

			shader = new CShader_SSAO("shaders/1_30/ssao_blur.vs.glsl", "shaders/1_30/ssao_blur.ps.glsl");
			m_Shaders["ssao_blur"] = shader;

			m_PPChain.AddShader(m_Shaders["deferred"]);
			m_PPChain.AddShader(m_Shaders["ssao"]);

		}

	}
	else
	{	
		std::ostringstream errorBuffer;
		errorBuffer << "Hardware requirements not met:\nMinimum GLSL Version: ";
		errorBuffer << GetGame()->GetMinGLSLVersion();
		errorBuffer << "\nDetected GLSL Version: ";
		errorBuffer << GetGame()->GetGLSLVersion();	

		log(LOG_TYPE_ERROR, errorBuffer.str());
	}
}
开发者ID:rrkpp,项目名称:kopengi,代码行数:58,代码来源:IRenderSystem.cpp


示例13: GetGame

void Script::ClearTeamRgnID(const CGUID& playerGuid)
{
	CPlayer* player = GetGame()->FindPlayer(playerGuid);
	if(player==NULL)
		return;


	GSTeam* team = GetOrganiCtrl()->GetGameTeamByID(player->GetTeamID());
	if(team==NULL)
		return;

	CPlayer* master = GetGame()->FindPlayer(team->GetLeader());
	if(NULL != master)
	{
		GameManager::GetInstance()->GetRgnManager()->ClearTeamRgnGUID(playerGuid);
	}
	else
	{
		CMessage msg(MSG_S2W_TEAM_ClearRgnID);
		msg.Add(team->GetLeader());
		msg.Send(false);
	}
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:23,代码来源:ScriptRgnFunc.cpp


示例14: GetGame

 void Status::Render()
 {
     Game& game = GetGame();
     Screen& screen = game.GetScreen();
     m_sprite->Render(screen, 4, 0);
     if (!game.GetSnake().IsAlive())
     {
         m_gameover->Render(screen, (screen.GetWidth() / 2) - (m_gameover->GetWidth() / 2), (screen.GetHeight() / 2) - (m_gameover->GetHeight() / 2));
     }
     else if (game.IsPaused())
     {
         m_pause->Render(screen, (screen.GetWidth() / 2) - (m_pause->GetWidth() / 2), (screen.GetHeight() / 2) - (m_pause->GetHeight() / 2));
     }
 }
开发者ID:LastRitesGames,项目名称:Coatl,代码行数:14,代码来源:coatl_status.cpp


示例15: StepEndAI

void CFixSummonAI::AI()
{
	if(GetRemainedTime() == 0)
	{
		StepEndAI();
		return;
	}
	else
	{
		if(FindEffect(m_vecSummonEffect[0]) == NULL)
		{
			CClientRegion *pRegion = GetGame()->GetRegion();
			float x = GetPosX();
			float y = GetPosY();
			float h = pRegion->GetCellHeight(x, y);
			AddEffect(m_vecSummonEffect[0], x, y, h, true);

			char strFile[MAX_PATH];
			sprintf(strFile, "sounds/skills/%d.wav", m_vecSummonSound[0]);
			GetGame()->GetAudioList()->Play(strFile, x, y, h);
		}
	}
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:23,代码来源:FixSummonAI.cpp


示例16: GetStringParam

double CScript::GetPlayerAllVariables(const char* CmdStr, char* retStr)
{
	if(p_SrcShape == NULL) return 0;

	CHAR* szName = GetStringParam( CmdStr, 0 );
	if( szName )
	{
		CPlayer* pPlayer = GetGame() -> FindPlayer( szName );
		if( pPlayer )
		{
			//##找到该玩家
			CHAR szText[10240] = {0};
			ZeroMemory( szText, sizeof(szText) );

			CVariableList* pVarList = pPlayer->GetVariableList();

			if (pVarList)
			{
				CVariableList::varlistitr itr = pVarList->VarListBegin();

				for(; itr != pVarList->VarListEnd(); itr++)
				{
					// 简单变量
					if( itr->second->Array == 0 )
					{
						_snprintf(szText, 10240, "%s = %d", itr->first.c_str(), (int)(itr->second->Value));
						((CPlayer*)p_SrcShape) -> SendNotifyMessage( szText, 0xff00ff00, 0, eNOTIFYPOS_LEFT_BOTTOM );
					}
					else if( itr->second->Array > 0)	// 数组变量
					{
						for(int j = 0; j < itr->second->Array; j++)
						{
							_snprintf(szText, 10240, "%s[%d] = %d", itr->first.c_str(), j, itr->second->Value[j]);
							((CPlayer*)p_SrcShape) -> SendNotifyMessage( szText, 0xff00ff00, 0, eNOTIFYPOS_LEFT_BOTTOM );
						}
					}
					else
					{	//字符串变量
						_snprintf(szText, 10240, "%s = \"%s\"", itr->first.c_str(), itr->second->strValue);
						((CPlayer*)p_SrcShape) -> SendNotifyMessage( szText, 0xff00ff00, 0, eNOTIFYPOS_LEFT_BOTTOM );
					}
				}
			}
		}

		M_FREE( szName, sizeof(char)*MAX_VAR_LEN );
	}

	return 1;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:50,代码来源:ClientViewFun.cpp


示例17: InitOperThread

void CBounsDBManager::InitOperThread(std::string strProvider, 
									 std::string strDataSource, 
									 std::string strInitialCatalog, 
									 std::string strUserID, 
									 std::string strPassword)
{
	for(int i=0; i<GetGame()->GetSetup()->dwWorkerThreadNum; i++)
	{
		CBounsOperThread* pOperThread = new CBounsOperThread(strProvider, strDataSource, 
									strInitialCatalog,	strUserID, strPassword);
		m_mapOperThread[i] = pOperThread;
		pOperThread->Begin();
	}
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:14,代码来源:BounsDBManager.cpp


示例18: enet_host_destroy

bool NNetwork::CreateClient()
{
    if (Client)
    {
        enet_host_destroy(Client);
    }
    Client = enet_host_create(NULL,1,2,0,0);
    if (!Client)
    {
        GetGame()->GetLog()->Send("NETWORK",0,"Failed to create client!");
        return 1;
    }
    return 0;
}
开发者ID:ZenX2,项目名称:Astrostruct,代码行数:14,代码来源:NNetwork.cpp


示例19: GetGame

//! 解散
void GameFaction::Disband(void)
{
	map<CGUID, tagFacMemInfo>::iterator ite = m_mapMemInfo.begin();
	for ( ; ite != m_mapMemInfo.end(); ++ite)
	{
		CPlayer *pPlayer = GetGame()->FindPlayer(ite->first);
		if (NULL != pPlayer)
		{
			pPlayer->SetFactionID(NULL_GUID);
			pPlayer->SetUnionID(NULL_GUID);
			pPlayer->SetFacMemInfo(NULL);
		}
	}
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:15,代码来源:GameFaction.cpp


示例20: GetGame

void NTexture::Play(std::string i_Name)
{
    for (unsigned int i=0;i<Animations.size();i++)
    {
        if (i_Name == Animations[i]->GetName())
        {
            PlayingAnimation = i;
            if (ResetOnPlay)
                CurrentTime = 0;
            return;
        }
    }
    GetGame()->GetLog()->Send("TEXTURE",1,"Animation " + i_Name + " not found in texture " + Name + ".");
}
开发者ID:ZenX2,项目名称:Astrostruct,代码行数:14,代码来源:NTexture.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetGameObject函数代码示例发布时间:2022-05-30
下一篇:
C++ GetGalCanvas函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap