Beispiel #1
0
        public void SetLocation(int x, int z)
        {
            int relX = LocalX + (x - X);
            int relZ = LocalZ + (z - Z);

            ChunkRef c = _container.SetChunk(relX, relZ, GetChunk());

            _container = c._container;
            _cx        = c._cx;
            _cz        = c._cz;
        }
Beispiel #2
0
        /// <summary>
        /// Create a reference to a chunk stored in a chunk container.
        /// </summary>
        /// <param name="container">Chunk container</param>
        /// <param name="cx">Local X-coordinate of chunk within container.</param>
        /// <param name="cz">Local Z-coordinate of chunk within container.</param>
        /// <returns>ChunkRef representing a reference to a physical chunk at the specified location within the container.</returns>
        public static ChunkRef Create(IChunkContainer container, int cx, int cz)
        {
            if (!container.ChunkExists(cx, cz))
            {
                return(null);
            }

            ChunkRef c = new ChunkRef();

            c._container = container;
            c._cx        = cx;
            c._cz        = cz;

            return(c);
        }
Beispiel #3
0
        public void SetLocation(int x, int z)
        {
            int relX = LocalX + (x - X);
            int relZ = LocalZ + (z - Z);

            ChunkRef c = _container.SetChunk(relX, relZ, GetChunk());

            _container = c._container;
            _cx = c._cx;
            _cz = c._cz;
        }
Beispiel #4
0
        /// <summary>
        /// Create a reference to a chunk stored in a chunk container.
        /// </summary>
        /// <param name="container">Chunk container</param>
        /// <param name="cx">Local X-coordinate of chunk within container.</param>
        /// <param name="cz">Local Z-coordinate of chunk within container.</param>
        /// <returns>ChunkRef representing a reference to a physical chunk at the specified location within the container.</returns>
        public static ChunkRef Create(IChunkContainer container, int cx, int cz)
        {
            if (!container.ChunkExists(cx, cz)) {
                return null;
            }

            ChunkRef c = new ChunkRef();

            c._container = container;
            c._cx = cx;
            c._cz = cz;

            return c;
        }
Beispiel #5
0
        public void SetLocation(int x, int z)
        {
            ChunkRef c = _container.SetChunk(x, z, GetChunk());

            _container = c._container;
            _cx = c._cx;
            _cz = c._cz;
        }