Ejemplo n.º 1
0
 public bool CompareWWCTString(WWCTString string1, WWCTString string2)
 {
     if (string1.Index == string2.Index && string1.Path == string2.Path && string1.Type == string2.Type)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        //imported constructor
        public WWCTFile(BinaryReader br)
        {
            uint magic      = br.ReadUInt32();
            uint version    = br.ReadUInt32();
            uint WWBKCount  = br.ReadUInt32();
            uint WWPKCount  = br.ReadUInt32();
            uint WWEVCount  = br.ReadUInt32();
            uint WWSWCount  = br.ReadUInt32();
            uint WWSTCount  = br.ReadUInt32();
            uint WWGPCount  = br.ReadUInt32();
            uint WWENFCount = br.ReadUInt32();
            uint Unkn3Count = br.ReadUInt32();

            if (WWEVCount > 0)
            {
                for (int i = 0; i < WWEVCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWEV, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWBKCount > 0)
            {
                for (int i = 0; i < WWBKCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWBK, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWPKCount > 0)
            {
                for (int i = 0; i < WWPKCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWPK, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWSWCount > 0)
            {
                for (int i = 0; i < WWSWCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWSW, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWSTCount > 0)
            {
                for (int i = 0; i < WWSTCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWST, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWGPCount > 0)
            {
                for (int i = 0; i < WWGPCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWGP, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (WWENFCount > 0)
            {
                for (int i = 0; i < WWENFCount; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.WWENF, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            if (Unkn3Count > 0)
            {
                for (int i = 0; i < Unkn3Count; i++)
                {
                    uint       newIndex  = br.ReadUInt32();
                    string     newString = HelperFunctions.ReadNullTerminatedString(br);
                    WWCTString newWWCTS  = new WWCTString(WWCTType.Unkn3, newString, newIndex);
                    wwctStrings.Add(newWWCTS);
                }
            }
            br.Close();
        }