/[MorrowindCustomClothingSlotCreator]/trunk/libTES3FileFormat/PlugingClothing.cs
ViewVC logotype

Diff of /trunk/libTES3FileFormat/PlugingClothing.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libTES3FileFormat/PlugingClothing.cs	2011/07/29 18:22:20	20
+++ trunk/libTES3FileFormat/PlugingClothing.cs	2011/07/29 18:34:38	22
@@ -48,8 +48,13 @@
 
         byte[] CLOT_OTHER_DATA { get; set; } // the rest of the clothing data entry
     }
-    public class ClothingEntry : IClothingEntry
+    public class ClothingEntry : IClothingEntry, IComparable
     {
+        #region IComparable Members
+
+        public int CompareTo(object obj) { return this.CLOT_NAME.CompareTo((obj as ClothingEntry).CLOT_NAME); }
+
+        #endregion
         public ClothingEntry()
         {
             this.Offset = 0;
@@ -105,6 +110,8 @@
         private byte[] _CLOT_OTHER_DATA;
         public byte[] CLOT_OTHER_DATA { get { return _CLOT_OTHER_DATA; } set { _CLOT_OTHER_DATA = value; } } // the rest of the clothing data entry
         #endregion
+
+ 
     }
 
     public interface IPlugingClothing : IParse, ICommit, IAsBytes, ISizeOffset
@@ -268,6 +275,7 @@
 
                 //break;
                 this.ClothingEntries.Add(entry);
+                this.ClothingEntries.Sort(); // sorting should not cause any major issues, since each entry holds its own offset
             }
                   
 

 

  ViewVC Help
Powered by ViewVC 1.1.22