本文整理汇总了C#中Strategy.GetInternalizedUnitRole方法的典型用法代码示例。如果您正苦于以下问题:C# Strategy.GetInternalizedUnitRole方法的具体用法?C# Strategy.GetInternalizedUnitRole怎么用?C# Strategy.GetInternalizedUnitRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strategy
的用法示例。
在下文中一共展示了Strategy.GetInternalizedUnitRole方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Evaluate
internal override ThreeValuedLogic Evaluate(Strategy strategy)
{
var compareValue = this.compare;
var compareRole = this.compare as IRoleType;
if (compareRole != null)
{
compareValue = strategy.GetInternalizedUnitRole(compareRole);
}
else
{
if (this.roleType.ObjectType is IUnit)
{
compareValue = this.roleType.Normalize(this.compare);
}
}
var comparable = strategy.GetInternalizedUnitRole(this.roleType) as IComparable;
if (comparable == null)
{
return ThreeValuedLogic.Unknown;
}
return comparable.CompareTo(compareValue) < 0
? ThreeValuedLogic.True
: ThreeValuedLogic.False;
}
示例2: Evaluate
internal override ThreeValuedLogic Evaluate(Strategy strategy)
{
var value = strategy.GetInternalizedUnitRole(this.roleType);
if (value == null)
{
return ThreeValuedLogic.Unknown;
}
var equalsValue = this.equals;
if (this.equals is IRoleType)
{
var equalsRole = (IRoleType)this.equals;
equalsValue = strategy.GetInternalizedUnitRole(equalsRole);
}
else
{
if (this.roleType.ObjectType is IUnit)
{
equalsValue = RoleTypeExtensions.Normalize(this.roleType, [email protected]);
}
}
if (equalsValue == null)
{
return ThreeValuedLogic.False;
}
return value.Equals(equalsValue)
? ThreeValuedLogic.True
: ThreeValuedLogic.False;
}
示例3: Evaluate
internal override ThreeValuedLogic Evaluate(Strategy strategy)
{
var firstValue = this.first;
var secondValue = this.second;
var firstRole = this.first as IRoleType;
if (firstRole != null)
{
firstValue = strategy.GetInternalizedUnitRole(firstRole);
}
else
{
if (this.roleType.ObjectType is IUnit)
{
firstValue = this.roleType.Normalize(this.first);
}
}
var secondRole = this.second as IRoleType;
if (secondRole != null)
{
secondValue = strategy.GetInternalizedUnitRole(secondRole);
}
else
{
if (this.roleType.ObjectType is IUnit)
{
secondValue = this.roleType.Normalize(this.second);
}
}
var comparable = strategy.GetInternalizedUnitRole(this.roleType) as IComparable;
if (comparable == null)
{
return ThreeValuedLogic.Unknown;
}
return (comparable.CompareTo(firstValue) >= 0 && comparable.CompareTo(secondValue) <= 0)
? ThreeValuedLogic.True
: ThreeValuedLogic.False;
}
示例4: Evaluate
internal override ThreeValuedLogic Evaluate(Strategy strategy)
{
var value = (string)strategy.GetInternalizedUnitRole(this.roleType);
if (value == null)
{
return ThreeValuedLogic.Unknown;
}
if (this.isEmpty)
{
return ThreeValuedLogic.False;
}
return this.regex.Match(value).Success
? ThreeValuedLogic.True
: ThreeValuedLogic.False;
}