本文整理汇总了C#中ParseState.ConvertCurrentToken方法的典型用法代码示例。如果您正苦于以下问题:C# ParseState.ConvertCurrentToken方法的具体用法?C# ParseState.ConvertCurrentToken怎么用?C# ParseState.ConvertCurrentToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParseState
的用法示例。
在下文中一共展示了ParseState.ConvertCurrentToken方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public static Node Parse(ParseState parsestate)
{
Operator @operator = parsestate.CurrentOperator;
if (@operator != Operator.Equals && @operator != Operator.NotEquals) return null;
parsestate.BaseNode.Arguments.Add(@operator);
++parsestate.TokenIndex;
AttackStateType ast = parsestate.ConvertCurrentToken<AttackStateType>();
if (ast == AttackStateType.None) return null;
parsestate.BaseNode.Arguments.Add(ast);
++parsestate.TokenIndex;
List<Combat.HitType> hittypes = new List<Combat.HitType>();
while (true)
{
if (parsestate.CurrentSymbol != Symbol.Comma) break;
++parsestate.TokenIndex;
Combat.HitType? hittype = parsestate.ConvertCurrentToken<Combat.HitType?>();
if (hittype == null)
{
--parsestate.TokenIndex;
break;
}
hittypes.Add(hittype.Value);
++parsestate.TokenIndex;
}
parsestate.BaseNode.Arguments.Add(hittypes.ToArray());
return parsestate.BaseNode;
}
示例2: Parse
public static Node Parse(ParseState parsestate)
{
Axis axis = parsestate.ConvertCurrentToken<Axis>();
if (axis == Axis.None) return null;
++parsestate.TokenIndex;
parsestate.BaseNode.Arguments.Add(axis);
return parsestate.BaseNode;
}
示例3: Parse
public static Node Parse(ParseState parsestate)
{
Operator @operator = parsestate.CurrentOperator;
if (@operator != Operator.Equals && @operator != Operator.NotEquals) return null;
++parsestate.TokenIndex;
xnaMugen.MoveType movetype = parsestate.ConvertCurrentToken<xnaMugen.MoveType>();
if (movetype == xnaMugen.MoveType.Unchanged || movetype == xnaMugen.MoveType.None) return null;
++parsestate.TokenIndex;
parsestate.BaseNode.Arguments.Add(@operator);
parsestate.BaseNode.Arguments.Add(movetype);
return parsestate.BaseNode;
}
示例4: Parse
public static Node Parse(ParseState parsestate)
{
Operator @operator = parsestate.CurrentOperator;
if (@operator != Operator.Equals && @operator != Operator.NotEquals) return null;
++parsestate.TokenIndex;
xnaMugen.Physics physics = parsestate.ConvertCurrentToken<xnaMugen.Physics>();
if (physics == xnaMugen.Physics.Unchanged || physics == xnaMugen.Physics.None) return null;
++parsestate.TokenIndex;
parsestate.BaseNode.Arguments.Add(@operator);
parsestate.BaseNode.Arguments.Add(physics);
return parsestate.BaseNode;
}
示例5: Parse
public static Node Parse(ParseState state)
{
if (state.CurrentSymbol != Symbol.LeftParen) return null;
++state.TokenIndex;
if (state.CurrentUnknown == null) return null;
xnaMugen.Assertion assert = state.ConvertCurrentToken<xnaMugen.Assertion>();
state.BaseNode.Arguments.Add(assert);
++state.TokenIndex;
if (state.CurrentSymbol != Symbol.RightParen) return null;
++state.TokenIndex;
return state.BaseNode;
}