本文整理汇总了C++中UnitObj::GameType方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitObj::GameType方法的具体用法?C++ UnitObj::GameType怎么用?C++ UnitObj::GameType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitObj
的用法示例。
在下文中一共展示了UnitObj::GameType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
//
// Submit asset requests directly to the manager
//
Bool Asset::Request::TypeBase::DirectEvaluation(Manager &manager)
{
// Iterate the units in the base an evaluate them
if (base.Alive())
{
for (UnitObjList::Iterator u(&base->GetUnits()); *u; u++)
{
if ((*u)->Alive())
{
UnitObj *unit = **u;
manager.Evaluation(*this, *unit, config->GetAmounts().Find(unit->GameType()->Id()) ? 1.0f : 0.0f);
}
}
}
return (TRUE);
}
示例2: ASSERT
//
// Offer
//
// The given asset is being offered, do we want it ?
//
Bool Asset::Request::TypeBase::Offer(Asset &asset)
{
// Get the unit out of the asset
UnitObj *unit = asset.GetUnit();
ASSERT(unit)
// Do we have enough of this type ?
U32 type = unit->GameType()->Id();
// We should only be offered this type if we asked for it
ASSERT(config->GetAmount(type))
// How many of this type do we currently have ?
U32 *amount = amounts.Find(type);
// Is this less that what we need ?
return ((!amount || *amount < config->GetAmount(type)) ? TRUE : FALSE);
}