Example #1
0
 public override object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     if (Node.NodeType == "NUMBER") return System.Convert.ToInt32(Node.Value);
     else if (Node.NodeType == "IDENT") return Context.NamedTiles[Node.Value.ToString()];
     else throw new InvalidOperationException("Block property conversion error");
 }
Example #2
0
 public override object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     return Node.Children.Select(c => c.Value.ToString()).ToArray();
 }
Example #3
0
 public override object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     return Enum.Parse(EnumType, Node.Value.ToString());
 }
Example #4
0
 public override object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     if (Node.Value.ToString() == "false") return false;
     else if (Node.Value.ToString() == "true") return true;
     else throw new InvalidOperationException("Block property conversion error");
 }
Example #5
0
 public virtual Object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     throw new NotImplementedException();
 }
Example #6
0
 public override object Convert(BlockSetLoadContext Context, Ancora.AstNode Node)
 {
     return Node.Value.ToString();
 }