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


C++ Evaluator::LogicAnd方法代码示例

本文整理汇总了C++中Evaluator::LogicAnd方法的典型用法代码示例。如果您正苦于以下问题:C++ Evaluator::LogicAnd方法的具体用法?C++ Evaluator::LogicAnd怎么用?C++ Evaluator::LogicAnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Evaluator的用法示例。


在下文中一共展示了Evaluator::LogicAnd方法的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) 
//.........这里部分代码省略.........
开发者ID:garinh,项目名称:cs,代码行数:101,代码来源:condeval.cpp


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