Exemple #1
0
        /// <summary>
        /// The add to languages.
        /// </summary>
        /// <param name="hash">
        /// The hash of the language.
        /// </param>
        /// <param name="representation">
        /// The representation of the language.
        /// </param>
        public void AddLang(ulong hash, uint representation, uint unk)
        {
            var b = new LanguageEntry {
                _name = hash, ID = representation, Unknown = unk
            };

            this.Languages[representation] = b;
        }
Exemple #2
0
        /// <summary>
        /// The language hash 2 id.
        /// </summary>
        /// <param name="lang_hash">
        /// The hash.
        /// </param>
        /// <returns>
        /// The matched ID.
        /// </returns>
        public uint IDFromLanguageHash(ulong lang_hash)
        {
            foreach (var kvpair in this.Languages)
            {
                LanguageEntry entry = kvpair.Value;
                if (entry._name == lang_hash)
                {
                    return(kvpair.Key);
                }
            }

            return(0);
        }