Example #1
0
 public void ReadFile(string FilePath)
 {
     try
     {
         BigEndianReader Reader = new BigEndianReader(new MemoryStream(File.ReadAllBytes(FilePath)));
         string          Magic  = Reader.ReadASCII(4);
         if (Magic == "PBLM")
         {
             BBLMEditor BBLMEditor = new BBLMEditor();
             BBLMEditor.ReadBBLM(FilePath);
         }
         else if (Magic == "PDOF")
         {
             BDOFEditor BDOFEditor = new BDOFEditor();
             BDOFEditor.ReadBDOF(FilePath);
         }
         else if (Magic == "LGHT")
         {
             BLIGHTEditor BLIGHTEditor = new BLIGHTEditor();
             BLIGHTEditor.ReadBLIGHT(FilePath);
         }
         else if (Magic == "LMAP")
         {
             BLMAPEditor BLMAPEditor = new BLMAPEditor();
             BLMAPEditor.ReadBLMAP(FilePath);
         }
         else if (new FileInfo(FilePath).Length == 0x70)
         {
             BFGEditor BFGEditor = new BFGEditor();
             BFGEditor.ReadBFG(FilePath);
         }
         else
         {
             throw new Exception("The file is invalid!");
         }
     }
     catch (Exception Ex)
     {
         this.Text = thisName;
         System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(Ex, true);
         throw new Exception(Ex.Message + Environment.NewLine + "Class Name: " + trace.GetFrame(0).GetMethod().ReflectedType.FullName + " Line: " + trace.GetFrame(0).GetFileLineNumber() + " Column: " + trace.GetFrame(0).GetFileColumnNumber());
     }
 }
Example #2
0
        public void NewBLMAP()
        {
            BLMAPEditor BLMAPEditor = new BLMAPEditor();

            BLMAPEditor.NewBLMAP();
        }