本文整理汇总了C#中Name.ApplyPerspective方法的典型用法代码示例。如果您正苦于以下问题:C# Name.ApplyPerspective方法的具体用法?C# Name.ApplyPerspective怎么用?C# Name.ApplyPerspective使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Name
的用法示例。
在下文中一共展示了Name.ApplyPerspective方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertPerspective
/// <summary>
///
/// </summary>
/// <param name="perspective">The perspective to evaluate</param>
/// <returns>The ToM sequenceList</returns>
private List<Name> AssertPerspective(Name perspective, string argumentName)
{
if(perspective == Name.NIL_SYMBOL)
throw new ArgumentException("Perspectives cannot contain NIL symbol",argumentName);
perspective = perspective.ApplyPerspective(Perspective);
List<Name> ToMList = new List<Name>();
if (perspective.IsUniversal)
{
ToMList.Add(Name.UNIVERSAL_SYMBOL);
return ToMList;
}
ToMList.Add(Name.SELF_SYMBOL);
if (perspective.IsPrimitive)
{
if(perspective != Name.SELF_SYMBOL)
ToMList.Add(perspective);
return ToMList;
}
if (!perspective.IsConstant)
throw new ArgumentException("The given Theory of the Mind perspective needs to be constant", argumentName);
//Validate ToM definition and ToM level
var eval = perspective;
while (eval.IsComposed)
{
if (eval.NumberOfTerms > 2)
throw new ArgumentException($"Invalid perspective format {perspective}", argumentName);
var f = eval.GetNTerm(0);
AssetToMList(ToMList, f, argumentName);
eval = eval.GetNTerm(1);
}
AssetToMList(ToMList, eval, argumentName);
return ToMList;
}