Example #1
0
        // the list of entitiies
        private IList <BCUserEntity> NewUserEntitiesFromJsonString(string in_json, JsonData in_entities)
        {
            List <BCUserEntity> entities = new List <BCUserEntity>();

            /*
             * IDictionary d = jsonObj["data"] as IDictionary;
             * if (d == null || !d.Contains("entities"))
             * {
             *  return entities;
             * }
             */
            try
            {
                //foreach (JsonData child in in_entities)
                JsonData child = null;
                for (int i = 0; i < in_entities.Count; ++i)
                {
                    child = in_entities[i];
                    BCUserEntity entity = null;
                    entity = NewUserEntity((string)child["entityType"]);
                    entity.ReadFromJson(child);
                    entities.Add(entity);
                }
            }
            catch (System.Exception)
            {
                /* do nadda */
            }

            return(entities);
        }
        public BCUserEntity NewUserEntity(string entityType)
        {
            BCUserEntity e = (BCUserEntity)CreateRegisteredEntityClass(entityType);

            if (e == null)
            {
                e = new BCUserEntity(m_bcEntityService);
            }
            e.EntityType = entityType;
            return(e);
        }
Example #3
0
        public BCUserEntity NewUserEntity(string entityType)
        {
            BCUserEntity e = (BCUserEntity)CreateRegisteredEntityClass(entityType);

            if (e == null)
            {
                e = new BCUserEntity();
            }
            e.BrainCloud = m_braincloud;
            e.EntityType = entityType;
            return(e);
        }
        public BCUserEntity NewUserFromDictionary(Dictionary <string, object> in_dict)
        {
            BCUserEntity toReturn = null;

            if (in_dict != null)
            {
                try
                {
                    toReturn = NewUserEntity((string)in_dict["entityType"]);
                    toReturn.ReadFromJson(in_dict);
                }
                catch (Exception)
                {
                    /* do nadda */
                }
            }

            return(toReturn);
        }
        // the list of entitiies
        public IList <BCUserEntity> NewUserEntitiesFromJsonString(string json, Array entitiesJson)
        {
            List <BCUserEntity>         entities = new List <BCUserEntity>();
            Dictionary <string, object> child    = null;

            for (int i = 0; i < entitiesJson.Length; ++i)
            {
                try
                {
                    child = entitiesJson.GetValue(i) as Dictionary <string, object>;
                    BCUserEntity entity = NewUserFromDictionary(child);
                    entities.Add(entity);
                }
                catch (Exception)
                {
                    /* do nadda */
                }
            }
            return(entities);
        }
Example #6
0
        // the list of entitiies
        private IList <BCUserEntity> NewUserEntitiesFromJsonString(string json, JsonData entitiesJson)
        {
            List <BCUserEntity> entities = new List <BCUserEntity>();
            JsonData            child    = null;

            for (int i = 0; i < entities.Count; ++i)
            {
                try
                {
                    child = entitiesJson[i];
                    BCUserEntity entity = null;
                    entity = NewUserEntity((string)child["entityType"]);
                    entity.ReadFromJson(child);
                    entities.Add(entity);
                }
                catch (System.Exception)
                {
                    /* do nadda */
                }
            }
            return(entities);
        }