public PathNode(Lisp.Parser parser) { int d = parser.Depth; while (parser.Parse() && parser.Depth >= d) { if (parser.Depth == d + 1) { if (parser.Type != Lisp.Parser.LispType.SYMBOL) { throw new Exception("expected SYMBOL"); } string symbol = parser.SymbolValue; parser.Parse(); switch (symbol) { case "x": this.x = parser.FloatValue; break; case "y": this.x = parser.FloatValue; break; case "time": this.x = parser.FloatValue; break; default: throw new Exception("Unknown Token in Path Node"); } } } }
protected override bool tryParse(string symbol, Lisp.Parser parser) { switch (symbol) { case "name": this.name = parser.StringValue; return(true); case "node": this.pathNodes.Add(new PathNode(parser)); return(true); default: return(base.tryParse(symbol, parser)); } }
public Path(string name, Lisp.Parser parser) : base(name, parser) { }
public override GameObject ParseAsThis(string name, Lisp.Parser parser) { return(new SpatialGameObject(name, parser)); }