示例#1
0
        /// <summary>
        ///     Saves this instance to json.
        /// </summary>
        public virtual void Save(LogicJSONObject jsonObject)
        {
            jsonObject.Put("x", new LogicJSONNumber(this.GetTileX()));
            jsonObject.Put("y", new LogicJSONNumber(this.GetTileY()));

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

                if (component != null)
                {
                    component.Save(jsonObject);
                }
            }
        }
        public virtual void Save(LogicJSONObject jsonObject, int villageType)
        {
            jsonObject.Put("x", new LogicJSONNumber(this.GetTileX() & 63));
            jsonObject.Put("y", new LogicJSONNumber(this.GetTileY() & 63));

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

                if (component != null)
                {
                    component.Save(jsonObject, villageType);
                }
            }
        }