Beispiel #1
0
        public Chunk(World world, ChunkPosition position, IEnvironmentGenerator environmentGenerator, IChunkRenderer renderer, BlockPrototypeMap prototypeMap)
        {
            Position = position;
            this.world = world;
            this.environmentGenerator = environmentGenerator;
            this.renderer = renderer;

            blockArray = new BlockArray(prototypeMap, XDimension, YDimension, ZDimension);
            lightArray = new Array3<byte>(XDimension, YDimension, ZDimension);

            OriginInWorld = new BlockPosition(Position, new RelativeBlockPosition(0, 0, 0));
            neighborhoodPositions = new[]
            {
                Position,
                Position.Left,
                Position.Right,
                Position.Front,
                Position.Back
            };
        }
Beispiel #2
0
 public BlockArray(BlockPrototypeMap prototypeMap, int xDimension, int yDimension, int zDimension)
 {
     this.prototypeMap = prototypeMap;
     blockIndexes = new Array3<byte>(xDimension, yDimension, zDimension);
 }
Beispiel #3
0
 public ChunkFactory(IEnvironmentGenerator environmentGenerator, Func<IChunkRenderer> chunkRendererFactory)
 {
     this.environmentGenerator = environmentGenerator;
     this.chunkRendererFactory = chunkRendererFactory;
     prototypeMap = new BlockPrototypeMap();
 }