/// <summary>
        /// Parse out the default name of the attribute if it's already defined in
        /// <see cref="ObjectGameBaseAttributeValues"/> or parse it out cross referencing
        /// with data in <see cref="Universe"/>.  Also grab the flags and textual information.
        /// </summary>
        private static TinyMushObjectAttribute MakeAttribute(MushEntryAttribute mea, long owner)
        {
            var attr = new TinyMushObjectAttribute();
            if (Enum.IsDefined(typeof (ObjectGameBaseAttributeValues), (ObjectGameBaseAttributeValues) mea.Id))
            {
                //	Dealing with stock game attribute
                attr.Name = Enum.ToObject(typeof (ObjectGameBaseAttributeValues), mea.Id).ToString();
            }
            else
            {
                ProcessUserAttribute(mea, ref attr);
                if (attr == null)
                {
                    return null;
                }
            }

            attr.Id = mea.Id;
            if (mea.Text[ 0 ] != Marker)
            {
                attr.Text = mea.Text;
                attr.Owner = owner;
                return attr;
            }

            ProcessComplexUserAttribute(mea, owner, ref attr);
            return attr;
        }
        /// <summary>
        /// Break apart the text of an attribute if needed and convert
        /// the owners and flags.
        /// </summary>
        private static void ProcessComplexUserAttribute(
			MushEntryAttribute mea, long owner, ref TinyMushObjectAttribute attr)
        {
            string temp = mea.Text.Substring(1);
            var p = ObjectDataParsers.AttributeParser().TryParse(temp);
            if (!p.WasSuccessful)
            {
                attr = null;
                return;
            }

            var t = p.Value;
            attr.Owner = owner;
            if (t.Item1 != "")
            {
                long own;
                bool didOwn = long.TryParse(t.Item1, out own);
                if (didOwn)
                {
                    attr.Owner = own;
                }
            }

            if (t.Item2 != "")
            {
                long flags;
                bool didFlags = long.TryParse(t.Item2, out flags);
                if (didFlags)
                {
                    AttributeFlags.SetFlags(flags, attr);
                }
            }

            if (t.Item3 == "")
            {
                return;
            }
            attr.Text = t.Item3;
        }
        /// <summary>
        /// Find the actual cross reference of a user attribute.
        /// </summary>
        private static void ProcessUserAttribute(MushEntryAttribute mea, ref TinyMushObjectAttribute attr)
        {
            if (!Universe.Attributes.ContainsKey(mea.Id))
            {
                attr = null;
                return;
            }

            string tempAttrName = Universe.Attributes[ mea.Id ].Text;
            if (!tempAttrName.Contains(":"))
            {
                attr = null;
                return;
            }

            //	Set flags for attribute
            var header = ParseAttributeHeader(tempAttrName);
            if (header == null)
            {
                attr = null;
                return;
            }

            AttributeFlags.SetFlags(header.Item1, attr);
            attr.Name = header.Item2;
        }
        public static void SetFlags(long flags, TinyMushObjectAttribute attr)
        {
            List<TinyMushAttributeFlags> res = new List<TinyMushAttributeFlags>();

            if ((flags & (long)AttributeFlags1.ODARK) != 0)
            {
                res.Add(TinyMushAttributeFlags.Odark);
            }
            if ((flags & (long)AttributeFlags1.DARK) != 0)
            {
                res.Add(TinyMushAttributeFlags.Dark);
            }
            if ((flags & (long)AttributeFlags1.WIZARD) != 0)
            {
                res.Add(TinyMushAttributeFlags.Wizard);
            }
            if ((flags & (long)AttributeFlags1.MDARK) != 0)
            {
                res.Add(TinyMushAttributeFlags.Mdark);
            }
            if ((flags & (long)AttributeFlags1.INTERNAL) != 0)
            {
                res.Add(TinyMushAttributeFlags.Internal);
            }
            if ((flags & (long)AttributeFlags1.NOCMD) != 0)
            {
                res.Add(TinyMushAttributeFlags.NoCmd);
            }
            if ((flags & (long)AttributeFlags1.LOCK) != 0)
            {
                res.Add(TinyMushAttributeFlags.Lock);
            }
            if ((flags & (long)AttributeFlags1.DELETED) != 0)
            {
                res.Add(TinyMushAttributeFlags.Deleted);
            }
            if ((flags & (long)AttributeFlags1.NOPROG) != 0)
            {
                res.Add(TinyMushAttributeFlags.NoProg);
            }
            if ((flags & (long)AttributeFlags1.GOD) != 0)
            {
                res.Add(TinyMushAttributeFlags.God);
            }
            if ((flags & (long)AttributeFlags1.IS_LOCK) != 0)
            {
                res.Add(TinyMushAttributeFlags.IsLock);
            }
            if ((flags & (long)AttributeFlags1.VISUAL) != 0)
            {
                res.Add(TinyMushAttributeFlags.Visual);
            }
            if ((flags & (long)AttributeFlags1.PRIVATE) != 0)
            {
                res.Add(TinyMushAttributeFlags.Private);
            }
            if ((flags & (long)AttributeFlags1.HTML) != 0)
            {
                res.Add(TinyMushAttributeFlags.Html);
            }
            if ((flags & (long)AttributeFlags1.NOPARSE) != 0)
            {
                res.Add(TinyMushAttributeFlags.NoParse);
            }
            if ((flags & (long)AttributeFlags1.REGEXP) != 0)
            {
                res.Add(TinyMushAttributeFlags.Regexp);
            }
            if ((flags & (long)AttributeFlags1.NOCLONE) != 0)
            {
                res.Add(TinyMushAttributeFlags.NoClone);
            }
            if ((flags & (long)AttributeFlags1.CONST) != 0)
            {
                res.Add(TinyMushAttributeFlags.Const);
            }
            if ((flags & (long)AttributeFlags1.CASE) != 0)
            {
                res.Add(TinyMushAttributeFlags.Case);
            }
            if ((flags & (long)AttributeFlags1.STRUCTURE) != 0)
            {
                res.Add(TinyMushAttributeFlags.Structure);
            }
            if ((flags & (long)AttributeFlags1.DIRTY) != 0)
            {
                res.Add(TinyMushAttributeFlags.Dirty);
            }
            if ((flags & (long)AttributeFlags1.DEFAULT) != 0)
            {
                res.Add(TinyMushAttributeFlags.Default);
            }
            if ((flags & (long)AttributeFlags1.NONAME) != 0)
            {
                res.Add(TinyMushAttributeFlags.NoName);
            }
            if ((flags & (long)AttributeFlags1.RMATCH) != 0)
            {
                res.Add(TinyMushAttributeFlags.Rmatch);
            }
            if ((flags & (long)AttributeFlags1.NOW) != 0)
            {
                res.Add(TinyMushAttributeFlags.Now);
            }
            if ((flags & (long)AttributeFlags1.TRACE) != 0)
            {
                res.Add(TinyMushAttributeFlags.Trace);
            }

            foreach (TinyMushAttributeFlags tmFlag in res)
            {
                attr.Flags.Add(tmFlag);
            }
        }