Exemple #1
0
        public static string GetAttributeName(NameIdentifier name)
        {
            string res = name.HashString();

            AttributeNames.TryGetValue(name.HashString(), out res);
            if (res == null)
            {
                res = name.HashString();
            }
            return(res);
        }
Exemple #2
0
        internal AttributeInfo(Reader reader)
        {
            Name = new NameIdentifier(reader);
            Type = (AttributeTypes)reader.ReadByte();
            string attribute = Objects.GetAttributeName(Name);

            if (attribute != null)
            {
                // Type mismatch
                //if (attribute.Type != Type) return;
                Name.Name = attribute;
            }
            else
            {
                var    everyAttribute = Objects.AttributeNames;
                string hashString     = Name.HashString();
                foreach (System.Collections.Generic.KeyValuePair <string, string> s in everyAttribute)
                {
                    NameIdentifier currentName       = new NameIdentifier(s.Value);
                    String         currentHashedName = currentName.HashString();
                    if (currentHashedName == hashString)
                    {
                        Name = currentName;
                        break;
                    }
                }
            }
        }
Exemple #3
0
        public static ObjectInfo GetObjectInfo(NameIdentifier name)
        {
            ObjectInfo res = null;

            hashToObject.TryGetValue(name.HashString(), out res);
            return(res);
        }
Exemple #4
0
        public AttributeInfo GetAttributeInfo(NameIdentifier name)
        {
            AttributeInfo res = null;

            hashToAttribute.TryGetValue(name.HashString(), out res);
            return(res);
        }