示例#1
0
 /// <summary>
 /// Creates and/or opens a game_pak file
 /// </summary>
 /// <param name="filePath">Filename of the pak</param>
 /// <param name="openAsReadOnly">Open pak in readOnly Mode if true. Ignored if createAsNewPak is set</param>
 /// <param name="createAsNewPak">If true, openAsReadOnly is ignored and will create a new pak at filePath location in read/write mode. Warning: This will overwrite any existing pak at that location !</param>
 public AAPak(string filePath, bool openAsReadOnly = true, bool createAsNewPak = false)
 {
     _header = new AAPakFileHeader(this);
     if (filePath != "")
     {
         bool isLoaded = false;
         if (createAsNewPak)
         {
             isLoaded = NewPak(filePath);
         }
         else
         {
             isLoaded = OpenPak(filePath, openAsReadOnly);
         }
         if (isLoaded)
         {
             isOpen = ReadHeader();
         }
         else
         {
             isOpen = false;
         }
     }
     else
     {
         isOpen = false;
     }
 }