本文整理汇总了C++中GetObj函数的典型用法代码示例。如果您正苦于以下问题:C++ GetObj函数的具体用法?C++ GetObj怎么用?C++ GetObj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetObj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadColors
static int ReadColors(CurPos &cp, const char *ObjName) {
unsigned char obj;
unsigned short len;
while ((obj = GetObj(cp, len)) != 0xFF) {
switch (obj) {
case CF_STRING:
{
char cl[30];
const char *sname = GetCharStr(cp, len);
const char *svalue;
if (sname == 0) return -1;
if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
if ((svalue = GetCharStr(cp, len)) == 0) return -1;
strcpy(cl, ObjName);
strcat(cl, ".");
strcat(cl, sname);
if (SetColor(cl, svalue) == 0) return -1;
}
break;
case CF_END:
return 0;
default:
return -1;
}
}
return -1;
}
示例2: GetCount
void CSpaceObjectList::Subtract (const CSpaceObjectList &List)
// Subtract
//
// Removes all objects in List from the current list
{
int i;
// Mark all current objects
int iCount = GetCount();
for (i = 0; i < iCount; i++)
GetObj(i)->SetMarked(true);
// Clear marks on all objects to remove
for (i = 0; i < List.GetCount(); i++)
List.GetObj(i)->SetMarked(false);
// Create a new list with the remaining objects
TArray<CSpaceObject *> NewList;
for (i = 0; i < iCount; i++)
if (GetObj(i)->IsMarked())
NewList.Insert(GetObj(i));
m_List.TakeHandoff(NewList);
}
示例3: ReadHilitColors
static int ReadHilitColors(CurPos &cp, EColorize *Colorize, const char * /*ObjName*/) {
unsigned char obj;
unsigned short len;
while ((obj = GetObj(cp, len)) != 0xFF) {
switch (obj) {
case CF_INT:
{
long cidx;
const char *svalue;
if (GetNum(cp, cidx) == 0) return -1;
if ((obj = GetObj(cp, len)) != CF_STRING)
return -1;
if ((svalue = GetCharStr(cp, len)) == 0)
return -1;
if (Colorize->SetColor(cidx, svalue) == 0)
return -1;
}
break;
case CF_END:
return 0;
default:
return -1;
}
}
return -1;
}
示例4: CStageMng
void CGameManager::start()
{
__super::start();
fileMng_.Load();
if (!GetObj(typeid(CStageMng)))
{
auto sm = std::shared_ptr<CStageMng>(new CStageMng());
AddObject2(sm);
TempCharacter t(sm);
sm->load();
#ifdef DEF_GM_PTR
//SetStageMngPtr(sm);
#endif
}
if (!GetObj(typeid(CScoreMng)))
{
auto sm = std::shared_ptr<CScoreMng>(new CScoreMng());
AddObject2(sm);
#ifdef DEF_GM_PTR
SetScoreMngPtr(sm);
#endif
}
if (!GetObj(typeid(CCollision)))
AddObject2(ObjPtr(new CCollision()));
}
示例5: GetObj
void CGenerator::fill(int from , int to , int id = 1 )
{
for(int z = from ; z < to ; z++)
for(int i = 0 ; i < X ; i++)
for(int j = 0 ; j < Y ; j++)
if(GetObj(glm::ivec3(i,j,z)) != 1)
GetObj(glm::ivec3(i,j,z)) = id;
}
示例6: ReadMenu
static int ReadMenu(CurPos &cp, const char *MenuName) {
unsigned char obj;
unsigned short len;
int menu = -1, item = -1;
menu = NewMenu(MenuName);
while ((obj = GetObj(cp, len)) != 0xFF) {
switch (obj) {
case CF_ITEM:
{
if (len == 0) {
item = NewItem(menu, 0);
} else {
const char *s = GetCharStr(cp, len);
int Cmd;
if (s == 0) return -1;
item = NewItem(menu, s);
if ((obj = GetObj(cp, len)) != CF_MENUSUB) return -1;
if ((Cmd = ReadCommands(cp, 0)) == -1) return -1;
Menus[menu].Items[item].Cmd = Cmd + 65536;
}
}
break;
case CF_SUBMENU:
{
const char *s = GetCharStr(cp, len);
const char *w;
if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
if ((w = GetCharStr(cp, len)) == 0) return -1;
item = NewSubMenu(menu, s, GetMenuId(w), SUBMENU_NORMAL);
}
break;
case CF_SUBMENUCOND:
{
const char *s = GetCharStr(cp, len);
const char *w;
if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
if ((w = GetCharStr(cp, len)) == 0) return -1;
item = NewSubMenu(menu, s, GetMenuId(w), SUBMENU_CONDITIONAL);
}
break;
case CF_END:
return 0;
default:
return -1;
}
}
return -1;
}
示例7: GetObj
void ledLightingDevice::OnChange()
{
cout << "New Value: " << m_cur_value << endl;
/* Update the D-Bus LightingObject */
GetObj()->m_cur_status = m_cur_value.c_str();
/* Notify status change */
lighting_object_emitSignal(GetObj(), E_LIGHTING_OBJECT_SIGNAL_CHANGED_STATUS, "DeviceName=lighting1&Command=get_status");
//DEV_AGENT->EmitSignalDeviceUpdate("DeviceName=lighting1&Command=get_status");
}
示例8: GetObj
void TemperatureDevice::OnChange()
{
cout << "New Value: " << m_cur_value << endl;
/* Update the D-Bus TemperatureObject */
GetObj()->m_cur_status = m_cur_value.c_str();
/* Notify status change */
temperature_object_emitSignal(GetObj(), E_TEMPERATURE_OBJECT_SIGNAL_CHANGED_STATUS, "DeviceName=temperature1&Command=get_status");
//DEV_AGENT->EmitSignalDeviceUpdate("DeviceName=temperature1&Command=get_status");
}
示例9: GetTree
//****************************
void CObjInfo::OnCloseObj()
{
if(GetTree())
{
GetTree()->RemoveFromList(GetObj(),GetObjName());
SetTree(0);
}
else
{
if(bDeleteObj&&GetObj())
{
delete GetObj();
SetObj(0);
}
}
};
示例10: LOG_DBG
SharedTrackablePtr
ObjRsrc::AllocObj(Trackable::ObjType type, string lookupName)
{
if (lookupName.length() == 0) {
LOG_DBG("Parameter lookupName has no value");
return Trackable::NullTrackablePtr;
}
SharedTrackablePtr newObj = AllocWorker(type);
if (newObj == Trackable::NullTrackablePtr) {
LOG_DBG("System unable to create object from heap");
return Trackable::NullTrackablePtr;
}
// Store this allocated object in a more permanent container
pair<TrackableMap::iterator, bool> result;
result = mObjGrpLife.insert(TrackablePair(lookupName, newObj));
if (result.second == false) {
LOG_DBG("Created object with collisions in lookupName: %s",
lookupName.c_str());
return Trackable::NullTrackablePtr;
}
return GetObj(lookupName);
}
示例11: SetDuiTimer
bool CDuiTimer::SetDuiTimer()
{
if((GetObj() && GetFun()) || GetHwnd())
return InnerSetTimer();
return false;
}
示例12: GetObj
void CDlgView::WriteCoinfig(const string& strFilePath)
{
Json::Value root;
Json::Value arraycomm;
Json::Value arraygame;
Json::Value arraylager;
Json::Value item;
map<string ,ADD_APP_DATA>::const_iterator it = m_commapp_list.begin();
for (; it!= m_commapp_list.end(); it++)
{
GetObj(it->second,item);
root["commapp"].append(item);
}
it = m_gameapp_list.begin();
for (; it!= m_gameapp_list.end(); it++)
{
GetObj(it->second,item);
root["lagerapp"].append(item);
}
it = m_Largeapp_list.begin();
for (; it!= m_Largeapp_list.end(); it++)
{
GetObj(it->second,item);
root["lagerapp"].append(item);
}
ofstream outfile(strFilePath);
if (!outfile.is_open())
{
return;
}
string strfile = root.toStyledString();
outfile<<strfile;
outfile.close();
//CStdioFile File;
//if (File.Open((LPCTSTR)(LPSTR)strFilePath.c_str(),CFile::modeWrite | CFile::modeCreate))
//{
// string strfile = root.toStyledString();
// File.WriteString(strfile.c_str());
// File.Close();
//}
//
}
示例13: GetObj
void XFileTransferProxy::Reset(void)
{
XFileTransfer *pFileTransfer;
pFileTransfer = (XFileTransfer *) GetObj();
if ( pFileTransfer )
pFileTransfer->Reset();
}
示例14: surrounded
bool CGenerator::surrounded(glm::ivec3 vec)
{
if(vec.z == -1)
return true;
bool is = true;
for(int k = -1 ; k < 2 ; k++)
for(int l = -1 ; l < 2 ; l++)
if( GetObj(glm::ivec3(vec.x+k,vec.y+l,vec.z)) != 1 )
is = false;
return is;
}
示例15: GetObj
BOOL CMyHelpDoc::SaveModified()
{
// return CRichEditDoc::SaveModified();
if(GetTree())//это режим в составе конфигурации
{
if(!GetObj()->bCanSave)
return TRUE;
CRichEditDoc::SetModifiedFlag(0);
CString Str;
((CMyHelpView*)GetView())->GetText(Str);
GetObj()->csFile=Str;
return TRUE;
}
else//это самостоятельный документ
{
return CRichEditDoc::SaveModified();
}
return TRUE;
}