Esempio n. 1
0
        static Gate fetchGate(string gateId, Gate targetGate)
        {
            if (targetGate == null)
            {
                return(null);
            }

            if ((targetGate != null) && (targetGate.ID == gateId))
            {
                return(targetGate);
            }

            Gate      result    = null;
            GatesList gatesList = targetGate as GatesList;

            if (gatesList != null)
            {
                for (int i = 0; i < gatesList.Count; i++)
                {
                    result = fetchGate(gateId, gatesList[i]);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts the given JSONObject into a gateslist.
        /// </summary>
        /// <returns>GatesList.</returns>
        /// <param name="gateObj">The JSON object to convert.</param>
        public new static GatesList fromJSONObject(JSONObject gateObj)
        {
            string className = gateObj[JSONConsts.SOOM_CLASSNAME].str;

            GatesList gatesList = (GatesList)Activator.CreateInstance(Type.GetType("Soomla.Levelup." + className), new object[] { gateObj });

            return(gatesList);
        }