Esempio n. 1
0
        public MetaPropertyAttribute(string name, BinPropertyType type, string otherClass, BinPropertyType primaryType, BinPropertyType secondaryType)
        {
            this.Name     = name;
            this.NameHash = Fnv1a.HashLower(name);

            this.OtherClass = otherClass;

            this.ValueType     = type;
            this.PrimaryType   = primaryType;
            this.SecondaryType = secondaryType;
        }
Esempio n. 2
0
        private static Dictionary <uint, string> ParseBinHashtable(string filePath)
        {
            Dictionary <uint, string> map = new Dictionary <uint, string>();

            foreach (string line in File.ReadAllLines(filePath))
            {
                string hashString = line.Split(" ")[1];
                uint   hash       = Fnv1a.HashLower(hashString);

                if (map.ContainsKey(hash) is false)
                {
                    map.Add(hash, hashString);
                }
            }

            return(map);
        }
Esempio n. 3
0
        public void WriteMetaClasses(Stream stream, ICollection <string> classNames, ICollection <string> propertyNames)
        {
            // Create dictionaries from collections
            Dictionary <uint, string> classNameMap    = new(classNames.Count);
            Dictionary <uint, string> propertyNameMap = new(propertyNames.Count);

            foreach (string className in classNames)
            {
                classNameMap.Add(Fnv1a.HashLower(className), className);
            }

            foreach (string propertyName in propertyNames)
            {
                propertyNameMap.Add(Fnv1a.HashLower(propertyName), propertyName);
            }

            WriteMetaClasses(stream, classNameMap, propertyNameMap);
        }
Esempio n. 4
0
 public MetaHash(string value)
 {
     this.Hash  = Fnv1a.HashLower(value);
     this.Value = value;
 }
Esempio n. 5
0
 public static BinTreeObject Serialize <T>(MetaEnvironment environment, string path, T metaClass)
     where T : IMetaClass
 {
     return(Serialize(environment, Fnv1a.HashLower(path), metaClass));
 }
Esempio n. 6
0
 public MetaPropertyAttribute(string name, BinPropertyType type)
 {
     this.Name      = name;
     this.NameHash  = Fnv1a.HashLower(name);
     this.ValueType = type;
 }