示例#1
0
 /// <summary>Create a new Rmap instance with the specific LFD template</summary>
 /// <param name="category">The type of LFD file</param>
 /// <exception cref="System.ArgumentException">Cockpit LFDs do not contain Rmaps<br/><b>-or-</b><br/>Normal LFDs must be initialized with <see cref="Rmap(int)"/></exception>
 /// <remarks>Only usable with <see cref="LfdFile.LfdCategory.Battle"/> files, initializes for a <see cref="Text"/> and <see cref="Delt"/> resources.</remarks>
 public Rmap(LfdFile.LfdCategory category)
 {
     if (category == LfdFile.LfdCategory.Battle)
     {
         _name              = _defaultName;
         _headers           = new SubHeader[2];
         _headers[0].Type   = Resource.ResourceType.Text;
         _headers[0].Name   = "battle#";
         _headers[0].Offset = HeaderLength;
         _headers[0].Length = -1;
         _headers[1].Type   = Resource.ResourceType.Delt;
         _headers[1].Name   = "b#gal";
         _headers[1].Offset = -1;
         _headers[1].Length = -1;
     }
     else if (category == LfdFile.LfdCategory.Cockpit)
     {
         throw new ArgumentException("Cockpit LFDs do not use RMAP", "category");
     }
     else
     {
         throw new ArgumentException("Normal LFDs must be initialized with Rmap(int)", "category");
     }
     _type = ResourceType.Rmap;
 }
示例#2
0
 /// <summary>Creates a new Collection with the specified structure</summary>
 /// <param name="category">Structure of file to initialize</param>
 /// <remarks>Using <see cref="LfdFile.LfdCategory.Normal"/> is the same as using the blank constructor, otherwise structure is locked.<br/>
 /// Battle Delt palette is defined by EMPIRE.PLTTstandard and TOURDESK.PLTTtoddesk.</remarks>
 public ResourceCollection(LfdFile.LfdCategory category)
 {
     if (category == LfdFile.LfdCategory.Battle)
     {
         _items = new List <Resource>(2);
         _items.Add(new Text());
         _items[0].Name = "battle#";
         _items.Add(new Delt());
         _items[1].Name = "b#gal";
     }
     else if (category == LfdFile.LfdCategory.Cockpit)
     {
         _items = new List <Resource>(3);
         _items.Add(new Panl(true));
         _items.Add(new Mask());
         _items.Add(new Pltt());
     }
     else
     {
         CanEditStructure = true;
     }
 }