Пример #1
0
        /// <summary>
        /// Gets the title names that correspond with title ID's from a file
        /// </summary>
        /// <returns>List of title ID's with their accurate title names</returns>
        private Structs.CachedTitleName[] CachedFromFile(File f)
        {
            List <Structs.CachedTitleName> tnl = new List <Structs.CachedTitleName>();
            int BlockLength = 0x34;

            Streams.Reader r = new Streams.Reader(f.GetStream());
            for (int i = 0, Previous = 0; i < r.BaseStream.Length / BlockLength; i++, Previous += 0x34)
            {
                // Set the position of the stream
                r.BaseStream.Position = Previous;
                // Create the new CachedTitleName struct
                Structs.CachedTitleName TN = new Structs.CachedTitleName();
                // Read the title ID
                TN.ID = r.ReadUInt32();
                // Read the name
                TN.Name = r.ReadCString();
                // Add that to the list
                tnl.Add(TN);
            }
            return(tnl.ToArray());
        }