示例#1
0
        public bool Add(string ident, ref GameViewObj obj)
        {
            if (ident == null || obj == null ||
                ident.Length == 0)
            {
                return(false);
            }

            try
            {
                obj.SetIdent(ident);
                obj.SetHash(Tools.GetHashValueCase(ident));
                if (mObjects.ContainsKey(ident))
                {
                    return(false);
                }

                mObjects.Add(ident, obj);
            }
            catch (Exception ex)
            {
                LogSystem.Log("Error,GameObjectSet.Add Exception:", ex.ToString());
                return(false);
            }
            return(true);
        }
示例#2
0
        public bool Add(ObjectID ident, ref GameViewObj obj)
        {
            if (obj == null ||
                ident.IsNull())
            {
                return(false);
            }

            try
            {
                obj.SetIdent(ident);
                obj.SetHash(Tools.GetHashValueCase(ident));
                if (mObjects.ContainsKey(ident))
                {
                    return(false);
                }

                mObjects.Add(ident, obj);
            }
            catch (Exception ex)
            {
                //Log.Trace("Error,GameObjectSet.Add Exception:" + ex.ToString());
                return(false);
            }
            return(true);
        }