本文整理匯總了C++中GetGame函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetGame函數的具體用法?C++ GetGame怎麽用?C++ GetGame使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetGame函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: switch
void App::onMenuCommand( WORD id )
{
switch( id )
{
case IDM_EXIT:
onQuit();
break;
case IDM_RELOADSETUP:
GetGame()->reload_setup();
break;
}
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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());
}
示例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();
}
示例8: glDeleteBuffers
NTextInput::~NTextInput()
{
glDeleteBuffers(2,Buffers);
delete[] Buffers;
if (Texture)
{
delete Texture;
}
if (HasFocus)
{
GetGame()->GetInput()->SetFocus(false);
}
}
示例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;
}
示例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");
}
示例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();
}
示例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());
}
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
}