Esempio n. 1
0
        public bool dataEqualFor(GeoBlock block)
        {
            GeoByteBuffer geoBlockData = _geoBlocksData[block.getBlockX(), block.getBlockY()];

            geoBlockData.clear();
            return(block.dataEquals(geoBlockData));
        }
Esempio n. 2
0
        public void convertBlock(GeoBlock block, byte type)
        {
            int      blockX = block.getBlockX();
            int      blockY = block.getBlockY();
            GeoBlock convertedBlock;

            //
            switch (type)
            {
            case GeoEngine.GEO_BLOCK_TYPE_FLAT:
                convertedBlock = GeoBlockFlat.convertFrom(block).setRegion(this);
                break;

            case GeoEngine.GEO_BLOCK_TYPE_COMPLEX:
                convertedBlock = GeoBlockComplex.convertFrom(block).setRegion(this);
                break;

            case GeoEngine.GEO_BLOCK_TYPE_MULTILAYER:
                convertedBlock = GeoBlockMultiLayer.convertFrom(block).setRegion(this);
                break;

            default:
                throw new ArgumentException("Unkown type: " + type, "type");
            }
            //
            block.unload();
            _geoBlocks[blockX, blockY] = convertedBlock;
        }
Esempio n. 3
0
        public void restoreBlock(GeoBlock block)
        {
            int           blockX = block.getBlockX();
            int           blockY = block.getBlockY();
            GeoByteBuffer reader = _geoBlocksData[blockX, blockY];

            reader.clear();
            block.unload();
            _geoBlocks[blockX, blockY] = readBlock(blockX, blockY, reader, true);
        }
Esempio n. 4
0
        //-----------------------------

        private GeoBlockEntry getEntry(GeoBlock block)
        {
            return(_selected[block.getBlockX() * GeoEngine.GEO_REGION_SIZE + block.getBlockY()]);
        }