本文整理汇总了C++中Evaluator::LogicOr方法的典型用法代码示例。如果您正苦于以下问题:C++ Evaluator::LogicOr方法的具体用法?C++ Evaluator::LogicOr怎么用?C++ Evaluator::LogicOr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluator
的用法示例。
在下文中一共展示了Evaluator::LogicOr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
typename Evaluator::EvalResult csConditionEvaluator::EvaluateInternal (
Evaluator& eval, csConditionID condition)
{
typedef typename Evaluator::EvalResult EvResult;
typedef typename Evaluator::BoolType EvBool;
typedef typename Evaluator::FloatType EvFloat;
typedef typename Evaluator::IntType EvInt;
EvResult result (eval.GetDefaultResult());
CondOperation op = conditions.GetCondition (condition);
switch (op.operation)
{
case opAnd:
result = eval.LogicAnd (op.left, op.right);
break;
case opOr:
result = eval.LogicOr (op.left, op.right);
break;
case opEqual:
{
if ((op.left.type == operandFloat)
|| (op.left.type == operandSVValueFloat)
|| (op.left.type == operandSVValueX)
|| (op.left.type == operandSVValueY)
|| (op.left.type == operandSVValueZ)
|| (op.left.type == operandSVValueW)
|| (op.right.type == operandFloat)
|| (op.right.type == operandSVValueX)
|| (op.right.type == operandSVValueY)
|| (op.right.type == operandSVValueZ)
|| (op.right.type == operandSVValueW)
|| (op.right.type == operandSVValueFloat))
{
EvFloat f1 (eval.Float (op.left));
EvFloat f2 (eval.Float (op.right));
result = f1 == f2;
}
else if (OpTypesCompatible (op.left.type, operandBoolean)
&& OpTypesCompatible (op.right.type, operandBoolean))
{
EvBool b1 (eval.Boolean (op.left));
EvBool b2 (eval.Boolean (op.right));
result = b1 == b2;
}
else
{
EvInt i1 (eval.Int (op.left));
EvInt i2 (eval.Int (op.right));
result = i1 == i2;
}
break;
}
case opNEqual:
{
if ((op.left.type == operandFloat)
|| (op.left.type == operandSVValueFloat)
|| (op.left.type == operandSVValueX)
|| (op.left.type == operandSVValueY)
|| (op.left.type == operandSVValueZ)
|| (op.left.type == operandSVValueW)
|| (op.right.type == operandFloat)
|| (op.right.type == operandSVValueX)
|| (op.right.type == operandSVValueY)
|| (op.right.type == operandSVValueZ)
|| (op.right.type == operandSVValueW)
|| (op.right.type == operandSVValueFloat))
{
EvFloat f1 (eval.Float (op.left));
EvFloat f2 (eval.Float (op.right));
result = f1 != f2;
}
else if (OpTypesCompatible (op.left.type, operandBoolean)
&& OpTypesCompatible (op.right.type, operandBoolean))
{
EvBool b1 (eval.Boolean (op.left));
EvBool b2 (eval.Boolean (op.right));
result = b1 != b2;
}
else
{
EvInt i1 (eval.Int (op.left));
EvInt i2 (eval.Int (op.right));
result = i1 != i2;
}
break;
}
case opLesser:
{
if ((op.left.type == operandFloat)
|| (op.left.type == operandSVValueFloat)
|| (op.left.type == operandSVValueX)
|| (op.left.type == operandSVValueY)
|| (op.left.type == operandSVValueZ)
|| (op.left.type == operandSVValueW)
|| (op.right.type == operandFloat)
|| (op.right.type == operandSVValueX)
|| (op.right.type == operandSVValueY)
|| (op.right.type == operandSVValueZ)
|| (op.right.type == operandSVValueW)
//.........这里部分代码省略.........