FindRecordByPath() public method

Find an ArchiveRecord by its path, or return null if not found.
public FindRecordByPath ( string path ) : ArchiveRecord
path string The path of the to search for.
return ArchiveRecord
Esempio n. 1
0
        /// <summary>Get the item language archive, which contains the <see cref="ItemArchiveId"/> <see cref="StringArchive"/>s.</summary>
        /// <param name="baseArchive"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        public static Archive GetItemLanguageArchive(Archive baseArchive, Language language = Language.English)
        {
            string        path   = string.Format(LanguageItemArchivePath, GetLanguageId(language));
            ArchiveRecord record = baseArchive.FindRecordByPath(path);

            if (record == null)
            {
                return(null);
            }
            Asset contents = record.Contents;

            return(contents as Archive);
        }
Esempio n. 2
0
        /// <summary>
        /// Get the game parameters archive.
        /// </summary>
        /// <returns></returns>
        public Archive GetGameParametersArchive()
        {
            if (GameParametersArchive != null)
            {
                return(GameParametersArchive);
            }

            Archive root = RootArchive;

            if (root == null)
            {
                return(null);
            }

            var archive = root.FindRecordByPath("param/GameParam/GameParam.parambnd.dcx");

            if (archive == null)
            {
                return(null);
            }

            return(GameParametersArchive = (Archive)archive.Contents);
        }
Esempio n. 3
0
 /// <summary>Get the item language archive, which contains the <see cref="ItemArchiveId"/> <see cref="StringArchive"/>s.</summary>
 /// <param name="baseArchive"></param>
 /// <param name="language"></param>
 /// <returns></returns>
 public static Archive GetItemLanguageArchive(Archive baseArchive, Language language = Language.English)
 {
     string path = string.Format(LanguageItemArchivePath, GetLanguageId(language));
     ArchiveRecord record = baseArchive.FindRecordByPath(path);
     if (record == null)
         return null;
     Asset contents = record.Contents;
     return contents as Archive;
 }