Пример #1
0
        public bool Load(StreamSerializer stream)
        {
            if (stream.ReadChunkBegin(CHUNK_ID, CHUNK_VERSION, "Grid2DPageStrategyData") == null)
            {
                return(false);
            }

            byte readMode = 0;

            stream.Read(out readMode);
            this.mMode = (Grid2Mode)readMode;

            Vector3 orgin;

            stream.Read(out orgin);
            Origin = orgin;

            stream.Read(out this.mCellSize);
            stream.Read(out this.mLoadRadius);
            stream.Read(out this.mHoldRadius);
            stream.Read(out this.mMinCellX);
            stream.Read(out this.mMaxCellX);
            stream.Read(out this.mMinCellY);
            stream.Read(out this.mMaxCellY);

            stream.ReadChunkEnd(CHUNK_ID);

            return(true);
        }
Пример #2
0
		public bool Load( StreamSerializer stream )
		{
			if ( stream.ReadChunkBegin( CHUNK_ID, CHUNK_VERSION, "Grid2DPageStrategyData" ) == null )
			{
				return false;
			}

			byte readMode = 0;
			stream.Read( out readMode );
			this.mMode = (Grid2Mode)readMode;

			Vector3 orgin;
			stream.Read( out orgin );
			Origin = orgin;

			stream.Read( out this.mCellSize );
			stream.Read( out this.mLoadRadius );
			stream.Read( out this.mHoldRadius );
			stream.Read( out this.mMinCellX );
			stream.Read( out this.mMaxCellX );
			stream.Read( out this.mMinCellY );
			stream.Read( out this.mMaxCellY );

			stream.ReadChunkEnd( CHUNK_ID );

			return true;
		}
Пример #3
0
        /// <summary>
        /// Load this data from a stream (returns true if successful)
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        public virtual bool Load(StreamSerializer stream)
        {
            if (stream.ReadChunkBegin(CHUNK_ID, CHUNK_VERSION, "Grid2DPageStrategyData") == null)
                return false;

            int readMode = 0;
            stream.Read(out readMode);
            mMode = (Grid2Mode)readMode;
            Vector3 orgin = new Vector3();
            stream.Read(out orgin);
            Origin = orgin;
            stream.Read(out mCellSize);
            stream.Read(out mLoadRadius);
            stream.Read(out mHoldRadius);

            uint id = 0;
            stream.ReadChunkEnd(id);
            CHUNK_ID = id;

            return true;
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        public Grid2DPageStrategyData()
        {
            mMode = Grid2Mode.G2D_X_Z;
            mWorldOrigin = Vector3.Zero;
            mOrigin = Vector2.Zero;
            mGridExtentsHorz = 65536;
            mGridExtentsVert = 65536;
            mCellSize = 1000;
            mLoadRadius = 2000;
            mHoldRadius = 3000;

            UpdateDerivedMetrics();
        }