Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
    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();
    }
Пример #3
0
        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("");
            }
        }
Пример #4
0
 private static void PrintProperty(CmdConsole tw, PropertyInfo item)
 {
     tw.Write($"  {item.Name,-18}  ");
     tw.Write(TypeToString(item.PropertyType) + "\n", ConsoleColor.Cyan);
 }
Пример #5
0
 public void GenerateDocument(CmdConsole tw, Type type)
 {
     GenerateDocument(tw, type, null);
 }