Esempio n. 1
0
// --------------------------------------------------------------------------------
// -------------------- RDOFunCalcNotExist
// --------------------------------------------------------------------------------
RDOValue RDOFunCalcNotExist::doCalc(const LPRDORuntime& pRuntime)
{
	bool res = true;
	RDORuntime::ResCIterator end = pRuntime->getResType(m_nResType)->res_end();
	for (RDORuntime::ResCIterator it = pRuntime->getResType(m_nResType)->res_begin(); it != end && res; it++)
	{
		if (*it == LPRDOResource(NULL))
			continue;

		pRuntime->pushGroupFunc(*it);
		if (m_pCondition->calcValue(pRuntime).getAsBool())
			res = false;
		pRuntime->popGroupFunc();
	}
	return RDOValue(res);
}
Esempio n. 2
0
// --------------------------------------------------------------------------------
// -------------------- RDOFunCalcForAll
// --------------------------------------------------------------------------------
RDOValue RDOFunCalcForAll::doCalc(const LPRDORuntime& pRuntime)
{
	bool first_found = false;
	bool res = true;
	RDORuntime::ResCIterator end = pRuntime->getResType(m_nResType)->res_end();
	for (RDORuntime::ResCIterator it = pRuntime->getResType(m_nResType)->res_begin(); it != end && res; it++)
	{
		if (*it == LPRDOResource(NULL))
			continue;

		pRuntime->pushGroupFunc(*it);
		if (!m_pCondition->calcValue(pRuntime).getAsBool())
		{
			res = false;
		}
		else if (!first_found)
		{
			first_found = true;
		}
		pRuntime->popGroupFunc();
	}
	return RDOValue(first_found ? res : false);
}