コード例 #1
0
ファイル: Program.cs プロジェクト: bgare89/OpenBYOND-1
        private static void LoadObjectTreeFrom(string file)
        {
            log.Info("Attempting object tree load...");

            DME dme = new DME();
            dme.LoadFile(file);

            ObjectTree otr = new ObjectTree();
            foreach (string filename in dme.Files)
            {
                if(filename.EndsWith(".dm"))
                    otr.ProcessFile(filename);
            }

            log.Info("TREE LOAD COMPLETE");

            Environment.Exit(0);
        }
コード例 #2
0
ファイル: DMETest.cs プロジェクト: bgare89/OpenBYOND-1
        //[DeploymentItem("TestFiles","TestFiles")]
        public void LoadFileTest()
        {
            //testContextInstance.WriteLine("CD: {0}", Environment.CurrentDirectory);

            DME target = new DME();
            string filename = Path.Combine("TestFiles","Test.dme");

            List<string> expected = new List<string>();
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "global.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "world.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "interface.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "skin.dmf")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "maps", "tgstation.dmm")));

            target.LoadFile(filename);

            Assert.AreEqual(target.Files.Count, 5, "Got incorrect # of files.");
            CollectionAssert.AllItemsAreInstancesOfType(target.Files, typeof(string), "Wrong types.");
            CollectionAssert.AreEqual(expected, target.Files, "Wrong entries");
        }
コード例 #3
0
        //[DeploymentItem("TestFiles","TestFiles")]
        public void LoadFileTest()
        {
            //testContextInstance.WriteLine("CD: {0}", Environment.CurrentDirectory);

            DME    target   = new DME();
            string filename = Path.Combine("TestFiles", "Test.dme");

            List <string> expected = new List <string>();

            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "global.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "world.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "interface.dm")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "skin.dmf")));
            expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "maps", "tgstation.dmm")));

            target.LoadFile(filename);

            Assert.AreEqual(target.Files.Count, 5, "Got incorrect # of files.");
            CollectionAssert.AllItemsAreInstancesOfType(target.Files, typeof(string), "Wrong types.");
            CollectionAssert.AreEqual(expected, target.Files, "Wrong entries");
        }
コード例 #4
0
        private static void LoadObjectTreeFrom(string file)
        {
            log.Info("Attempting object tree load...");

            DME dme = new DME();

            dme.LoadFile(file);

            ObjectTree otr = new ObjectTree();

            foreach (string filename in dme.Files)
            {
                if (filename.EndsWith(".dm"))
                {
                    otr.ProcessFile(filename);
                }
            }

            log.Info("TREE LOAD COMPLETE");

            Environment.Exit(0);
        }