static void Test14() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("Тексты", si.GetIdsByLabel("Тексты")[0]); Console.WriteLine(((DataString)db.Select(0, 0)).ContentString); }
static void Test10() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("-= <= RESOURCES => =-", si.GetIdsByLabel("-= <= RESOURCES => =-")[0]); Resource resource = (Resource)db.CurrentSection.Get(new Position(0, 0)); File.WriteAllBytes("D://MyDatabase/resultImage.png", resource.ContentData); }
static void Test4() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("Дампы времени", si.GetIdsByLabel("Дампы времени")[0]); foreach (Integer i in db.CurrentSection.AsList()) { Console.WriteLine(i.Label + " > " + i.ContentInt32); } }
static void Test2() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("ABC", si.GetIdsByLabel("ABC")[0]); foreach (DataString str in db.CurrentSection.AsList()) { Console.WriteLine(str.Label + " > " + str.ContentString); } }
static void Test12() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("Компоненты", si.GetIdsByLabel("Компоненты")[0]); Component com1 = (Component)db.CurrentSection.Get(new Position(0, 0)); Component com2 = (Component)db.CurrentSection.Get(new Position(0, 1)); Component com3 = (Component)db.CurrentSection.Get(new Position(0, 2)); Component com4 = (Component)db.CurrentSection.Get(new Position(0, 3)); Component com5 = (Component)db.CurrentSection.Get(new Position(0, 4)); Console.WriteLine("{0}, {1}, {2}, {3}, {4}", com1.Run(), com2.Run(), com3.Run(), com4.Run(), com5.Run()); }
static void Test8() { //need Test7() before run Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("Тест группировки", si.GetIdsByLabel("Тест группировки")[0]); Group group = (Group)db.CurrentSection.Get(grp); Console.WriteLine(group.Label); foreach (DataString str in db.CurrentSection.AsList(group.ContentLinks)) { Console.WriteLine(str.Label + " > " + str.ContentString); } }
static void Test6() { Database db = Database.FromResources("MyDatabase", "D://"); SectionsInfo si = new SectionsInfo(db); db.LoadSection("Хранение объектов", si.GetIdsByLabel("Хранение объектов")[0]); TestSctruct ts; foreach (Structure i in db.CurrentSection.AsList()) { ts = (TestSctruct)i.ContentData; Console.WriteLine(i.Label + " > " + ts.PlayerName + " " + ts.CreationTime.ToString() + " " + ts.X + " " + ts.Y + " " + ts.Z); } }