当前位置: 首页>>代码示例>>C++>>正文


C++ Condition::Init方法代码示例

本文整理汇总了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;
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:17,代码来源:Condition.cpp

示例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;
}
开发者ID:Ahmar,项目名称:hostile-takeover,代码行数:101,代码来源:TriggerConditions.cpp


注:本文中的Condition::Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。