예제 #1
0
 public Map(string Path, bool Loaded)
 {
     this.Path   = Path;
     this.Loaded = Loaded;
     if (!Loaded)
     {
         FS     = new FileStream(Path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
         Reader = new BinaryReader(FS);
         Writer = new BinaryWriter(FS);
     }
     else
     {
         FS     = new FileStream(Path, FileMode.Open, FileAccess.Read, FileShare.Read);
         Reader = new BinaryReader(FS);
         Writer = new BinaryWriter(new FileStream(Environment.GetLogicalDrives()[0] + "\\Data.Ambiguous", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite));
     }
     Header = MapHeader.GetHeader(Reader);
     FS.Flush();
     Index = MapIndex.GetMapIndex(Reader, Header);
     FS.Flush();
     StringTable = new SIDTable(this);
     FS.Flush();
     Tags = new TagTable(this);
     if (Header.MapName.Trim('\0') == "shared")
     {
         Index.SecondaryMagic += 0x3C000;
     }
 }
예제 #2
0
파일: Map.cs 프로젝트: Kantanomo/Ambiguous
 public Map(string Path, bool Loaded)
 {
     this.Path = Path;
     this.Loaded = Loaded;
     if (!Loaded)
     {
         FS = new FileStream(Path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
         Reader = new BinaryReader(FS);
         Writer = new BinaryWriter(FS);
     }
     else
     {
         FS = new FileStream(Path, FileMode.Open, FileAccess.Read, FileShare.Read);
         Reader = new BinaryReader(FS);
         Writer = new BinaryWriter(new FileStream(Environment.GetLogicalDrives()[0] + "\\Data.Ambiguous", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite));
     }
     Header = MapHeader.GetHeader(Reader);
     FS.Flush();
     Index = MapIndex.GetMapIndex(Reader, Header);
     FS.Flush();
     StringTable = new SIDTable(this);
     FS.Flush();
     Tags = new TagTable(this);
     if (Header.MapName.Trim('\0') == "shared")
         Index.SecondaryMagic += 0x3C000;
 }