Пример #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);
        }
Пример #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;
                    }
                }
            }
        }
Пример #3
0
        public static ObjectInfo GetObjectInfo(NameIdentifier name)
        {
            ObjectInfo res = null;

            hashToObject.TryGetValue(name.HashString(), out res);
            return(res);
        }
Пример #4
0
        public AttributeInfo GetAttributeInfo(NameIdentifier name)
        {
            AttributeInfo res = null;

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