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
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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;
 }