jan_flanders

Untitled

Jul 4th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using Reflect;
  2. using Type;
  3. if (settings.hasField(split[0]))
  4. {
  5.     switch (settings.field(split[0]).getClass().getClassName()))
  6.     {
  7.         case "String":
  8.             settings.setField(split[0], split.slice(1).join(" "));
  9.         case "Array":
  10.             settings.setField(split[0], split.slice(1));
  11.         default:
  12.             switch(settings.field(split[0]).typeof())
  13.             {
  14.                 case TBool: settings.setField(split[0], split[1] == "true" || split[1] == "yes");
  15.                 case TInt: settings.setField(Std.parseInt(split[1]));
  16.                 default:
  17.             }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment