Example #1
0
        /** @copydoc LayerParameterBase::Clone */
        public override LayerParameterBase Clone()
        {
            TileParameter p = new TileParameter();

            p.Copy(this);
            return(p);
        }
Example #2
0
        /** @copydoc LayerParameterBase::Copy */
        public override void Copy(LayerParameterBase src)
        {
            TileParameter p = (TileParameter)src;

            m_nAxis  = p.m_nAxis;
            m_nTiles = p.m_nTiles;
        }
Example #3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto proto = RawProto.Parse(br.ReadString());
            TileParameter p = FromProto(proto);

            if (!bNewInstance)
                Copy(p);

            return p;
        }
Example #4
0
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static TileParameter FromProto(RawProto rp)
        {
            string strVal;
            TileParameter p = new TileParameter();

            if ((strVal = rp.FindValue("axis")) != null)
                p.axis = int.Parse(strVal);

            if ((strVal = rp.FindValue("tiles")) != null)
                p.tiles = int.Parse(strVal);

            return p;
        }