public Solver(Sequence sequence) { blocks = new Matrix2d<E_BlockType>(sequence.blocks.width, sequence.blocks.height); for (int i = 0; i < blocks.width; i++) { for (int j = 0; j < blocks.height; j++) { blocks.Set(i, j, sequence.blocks.Get(i, j).blockType); } } deadBlocks = new Matrix2d<bool>(blocks.width, blocks.height); }
public Matrix2d<Block> ExportMatrix() { Matrix2d<Block> ret = new Matrix2d<Block>(blocks.width, blocks.height); blocks.ForAll( delegate(int x, int y, ref Block cell, ref bool stop) { Block block = null; if (cell != null) { block = new Block(cell); } ret.Set(x, y, block); } ); return ret; }