コード例 #1
0
 private void ReadHashValueSection(BinaryReader reader, ObservableCollection <CharacterCustomizationAppearances.HashValueEntry> collection, int count)
 {
     for (int i = 0; i < count; i++)
     {
         var entry = new CharacterCustomizationAppearances.HashValueEntry();
         // CSE is doing a version check here on ArchiveVersion < 195
         // Unt64 only read if ArchiveVersion >= 195, otherwise: https://github.com/PixelRick/CyberpunkSaveEditor/blob/7c47c6c7ce099c714e2ba43515380f99a2422c20/Source/cserialization/cnodes/CCharacterCustomization.hpp#L74
         entry.Hash          = reader.ReadUInt64();
         entry.FirstString   = reader.ReadPackedString();
         entry.SecondString  = reader.ReadPackedString();
         entry.TrailingBytes = reader.ReadBytes(8);
         collection.Add(entry);
     }
 }
        private List <CharacterCustomizationAppearances.HashValueEntry> ReadHashValueSection(BinaryReader reader, int count)
        {
            var result = new List <CharacterCustomizationAppearances.HashValueEntry>();

            for (int i = 0; i < count; i++)
            {
                var entry = new CharacterCustomizationAppearances.HashValueEntry();
                entry.Hash          = reader.ReadUInt64();
                entry.FirstString   = ParserUtils.ReadString(reader);
                entry.SecondString  = ParserUtils.ReadString(reader);
                entry.TrailingBytes = reader.ReadBytes(8);
                result.Add(entry);
            }
            return(result);
        }
コード例 #3
0
 public static bool IsPathValid(this CharacterCustomizationAppearances.HashValueEntry entry, string value)
 {
     return(pathHashes.Values.Contains(value));
 }
コード例 #4
0
 public static void SetPath(this CharacterCustomizationAppearances.HashValueEntry entry, string value)
 {
     entry.Hash = HashGenerator.CalcFNV1A64(value);
 }
コード例 #5
0
 public static string GetPath(this CharacterCustomizationAppearances.HashValueEntry entry)
 {
     return(pathHashes.ContainsKey(entry.Hash) ? pathHashes[entry.Hash] : string.Empty);
 }