public virtual void Load(LogicJSONObject jsonObject)
        {
            this.LoadPosition(jsonObject);

            for (int i = 0; i < LogicComponent.COMPONENT_TYPE_COUNT; i++)
            {
                LogicComponent component = this.m_components[i];

                if (component != null)
                {
                    component.Load(jsonObject);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Loads this instance from json.
        /// </summary>
        public virtual void Load(LogicJSONObject jsonObject)
        {
            LogicJSONNumber xNumber = jsonObject.GetJSONNumber("x");
            LogicJSONNumber yNumber = jsonObject.GetJSONNumber("y");

            for (int i = 0; i < this._components.Count; i++)
            {
                LogicComponent component = this._components[i];

                if (component != null)
                {
                    component.Load(jsonObject);
                }
            }

            if (xNumber == null || yNumber == null)
            {
                Debugger.Error("LogicGameObject::load - x or y is NULL!");
            }

            this.SetInitialPosition(xNumber.GetIntValue() << 9, yNumber.GetIntValue() << 9);
        }