private static void GenerateDocument(CmdConsole tw, Type type, List <Type> othertypes) { var props = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (var prop in props) { if (prop.CanWrite && prop.GetCustomAttributes(typeof(NotConfAttribute), false).Any() == false) { PrintProperty(tw, prop); var propType = prop.PropertyType; if (othertypes != null) { CheckType(othertypes, propType); } } } }
public override void _Ready() { Console.WriteLine("MAIN INIT"); _instance = this; console = new CmdConsole(); console.AddObserver("test", "", "Test console", ExecCmdTest); console.AddObserver("map", "", "Load a scene from the maps folder, eg 'map test_box'", ExecCmdScene); // init services factory = new GameFactory(this); cam = GetNode <GameCamera>("game_camera"); ui = GetNode <UI>("/root/ui"); Input.SetMouseMode(Input.MouseMode.Captured); // test stuff ZqfXml.ListAllAssemblyResources(Assembly.GetExecutingAssembly()); TestReadTextFile(); }
public void GenerateDocument(CmdConsole tw) { var types = from x in RegisteredTypes.Keys group x by RegisteredTypes[x]; var othertypes = new List <Type>(); foreach (var item in types) { var type = item.Key; tw.Write($"[Adatper type {type.Name} - '{string.Join("\', \'", item)}']\n", ConsoleColor.White); GenerateDocument(tw, type, othertypes); tw.WriteLine(""); } foreach (var type in othertypes) { tw.Write($"[type {type.Name}]\n", ConsoleColor.White); GenerateDocument(tw, type, othertypes); tw.WriteLine(""); } }
private static void PrintProperty(CmdConsole tw, PropertyInfo item) { tw.Write($" {item.Name,-18} "); tw.Write(TypeToString(item.PropertyType) + "\n", ConsoleColor.Cyan); }
public void GenerateDocument(CmdConsole tw, Type type) { GenerateDocument(tw, type, null); }