コード例 #1
0
ファイル: Chunk.cs プロジェクト: SaintGimp/GimpBlocks
        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
            };
        }
コード例 #2
0
ファイル: BlockArray.cs プロジェクト: SaintGimp/GimpBlocks
 public BlockArray(BlockPrototypeMap prototypeMap, int xDimension, int yDimension, int zDimension)
 {
     this.prototypeMap = prototypeMap;
     blockIndexes = new Array3<byte>(xDimension, yDimension, zDimension);
 }
コード例 #3
0
ファイル: ChunkFactory.cs プロジェクト: SaintGimp/GimpBlocks
 public ChunkFactory(IEnvironmentGenerator environmentGenerator, Func<IChunkRenderer> chunkRendererFactory)
 {
     this.environmentGenerator = environmentGenerator;
     this.chunkRendererFactory = chunkRendererFactory;
     prototypeMap = new BlockPrototypeMap();
 }