本文整理汇总了C++中Condition::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Condition::Init方法的具体用法?C++ Condition::Init怎么用?C++ Condition::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Condition
的用法示例。
在下文中一共展示了Condition::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatCondition
ScenarioObject* Condition::CreatCondition()
{
Condition *pCondition = new Condition;
pCondition->Init();
ms_Gravity.SetValue(_T("1"));
ms_ReTransLam.SetValue(_T("2300"));
ms_ReTransTurb.SetValue(_T("4000"));
ms_AtmosphericPress.SetValue(1);
ms_AtmosphericPress.SetUnit("atm");
ms_AtmosphericTemp.SetValue(_T("293.15"));
pCondition->SetValue(ms_Gravity,1);
pCondition->SetValue(ms_ReTransLam,2);
pCondition->SetValue(ms_ReTransTurb,3);
pCondition->SetValue(ms_AtmosphericPress,4);
pCondition->SetValue(ms_AtmosphericTemp,5);
return pCondition;
}
示例2: LoadCondition
//.........这里部分代码省略.........
case knCreditsCondition:
pcdn = new CreditsCondition();
break;
case knOwnsUnitsCondition:
pcdn = new OwnsUnitsCondition();
break;
case knAreaContainsUnitsCondition:
pcdn = new AreaContainsUnitsCondition();
break;
case knPlaceStructureModeCondition:
pcdn = new PlaceStructureModeCondition();
break;
case knMinerCantFindGalaxiteCondition:
pcdn = new MinerCantFindGalaxiteCondition();
break;
case knGalaxiteCapacityReachedCondition:
pcdn = new GalaxiteCapacityReachedCondition();
break;
case knElapsedTimeCondition:
pcdn = new ElapsedTimeCondition();
break;
case knSwitchCondition:
pcdn = new SwitchCondition();
break;
case knPeriodicTimerCondition:
pcdn = new PeriodicTimerCondition();
break;
case knDiscoversSideCondition:
pcdn = new DiscoversSideCondition();
break;
case knCountdownTimerCondition:
pcdn = new CountdownTimerCondition();
break;
case knTestPvarCondition:
pcdn = new TestPvarCondition();
break;
case knHasUpgradesCondition:
pcdn = new HasUpgradesCondition();
break;
#ifdef UNDONE
case knUnitDestroyedCondition:
pcdn = new UnitDestroyedCondition();
break;
case knDeathsCondition:
pcdn = new DeathsCondition();
break;
case knMobileHQDeployableCondition:
pcdn = new MobileHQDeployableCondition();
break;
case knMobileHQDeployedCondition:
pcdn = new MobileHQDeployedCondition();
break;
case knUnitSeesUnitCondition:
pcdn = new UnitSeesUnitCondition();
break;
case knUnitDestroyedCondition:
pcdn = new UnitDestroyedCondition();
break;
#endif
default:
Assert(false);
break;
}
// Init it, error if that failed
Assert(pcdn != NULL, "out of memory!");
if (!pcdn->Init(sz)) {
delete pcdn;
return false;
}
// Link it in last
Condition **ppcdn = &m_pcdn;
while ((*ppcdn) != NULL)
ppcdn = &((*ppcdn)->m_pcdnNext);
*ppcdn = pcdn;
return true;
}