本文整理汇总了C++中BinTree::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ BinTree::Find方法的具体用法?C++ BinTree::Find怎么用?C++ BinTree::Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinTree
的用法示例。
在下文中一共展示了BinTree::Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Set
//
// Set the cursor to be the active cursor
// Specifying 0 will use the system default cursor
//
Bool Set(U32 id)
{
ASSERT(sysInit);
// If id is 0 use the default cursor
if (id == 0)
{
id = standardCrs[0];
}
Base *crs = cursors.Find(id);
if (crs != NULL)
{
if (crs != current)
{
// Shutdown current
if (current)
{
current->Notify(Base::CN_DEACTIVATE);
}
// Start the cursor
current = crs;
current->Notify(Base::CN_ACTIVATE);
}
return (TRUE);
}
else
{
return (FALSE);
}
}
示例2: CmdHandler
///////////////////////////////////////////////////////////////////////////////
//
// Quake::CmdHandler
//
void CmdHandler(U32 pathCrc)
{
switch (pathCrc)
{
case 0x3860F45E: // "quake.active"
if (*active)
{
effect->StopByEffect();
effect->Play2D(Sound::Digital::DEFAULT_VOLUME, Sound::Digital::NO_OWNER, F32_MAX, 0);
soundoff = FALSE;
quakeAnim.SetFrame(0);
}
else
{
effect->StopByEffect();
soundoff = TRUE;
}
break;
case 0x030664FD: // "quake.type"
{
Type * t = typeList.Find( Crc::CalcStr( *typeVar));
if (t)
{
SetCurrent( t);
}
break;
}
case 0x44327F38: // "quake.listtypes"
{
char *s = NULL;
Console::GetArgString(1, s);
U32 len = 0;
if (s)
{
len = strlen(s);
}
// Registered quake types
CON_DIAG(("[Quake Types]"))
BinTree<Type>::Iterator i(&typeList);
for (!i; *i; i++)
{
if (!s || !Utils::Strnicmp( (*i)->name.str, s, len))
{
Console::Message("%s", (*i)->name.str);
}
}
break;
}
//
} // switch( pathCrc)
}
示例3: ProcessCreateCursor
//
// Process a CreateCursor scope
//
void ProcessCreateCursor(FScope *fScope)
{
// Cursor name is first argument
const char *name = fScope->NextArgString();
// Cursor class is second argument
const char *cls = fScope->NextArgString();
// Create the cursor
Base *newCrs = NULL;
U32 key = Crc::CalcStr(cls);
switch (key)
{
case 0x5B2A0A5F: // "Null"
newCrs = new Base;
break;
case 0xE04B5BBC: // "Bitmap"
newCrs = new Bmp;
break;
case 0xE5A51519: // "Geometric"
newCrs = new Geometric;
break;
default:
{
Base *derived;
if ((derived = cursors.Find(key)) != NULL)
{
newCrs = new Derived(derived);
}
else
{
LOG_ERR(("Unknown Cursor Class [%s]", cls));
return;
}
break;
}
}
// Configure the cursor
newCrs->Configure(fScope);
// Add it to the list
cursors.Add(Crc::CalcStr(name), newCrs);
}
示例4: FindByName
//
// Find a cursor by name
//
U32 FindByName(const char *name)
{
U32 id = Crc::CalcStr(name);
// Ensure the cursor exists
if (cursors.Find(id))
{
return (id);
}
else
{
LOG_ERR(("Cursor [%s] not found", name));
return (0);
}
}