private void place(int x, int y, int z, bool rotate) { Blocks b = select.SelectedBlock; Blocks t = currentSim[x, y, z]; if (t.Type == b.Type && t.canRotate && rotate) { currentSim.RotateMount(x, y, z); } else { currentSim.SetBlock(x, y, z, b.Type); } Display.Refresh(); }
public void AddLayer() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X, this.currentSim.Y, this.currentSim.Z + 1); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i, j, k) == BlockType.AIR) { continue; } _newSim.SetBlock(i, j, k, currentSim.GetBlockType(i, j, k)); } } } _newSim.setAllConnections(); SetUpInternalDisplay(_newSim); }
public void addLeftColumn() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X + 1, this.currentSim.Y, this.currentSim.Z); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i, j, k) == BlockType.AIR) { continue; } _newSim.SetBlock(i + 1, j, k, currentSim.GetBlockType(i, j, k)); } } } SetUpInternalDisplay(_newSim); }
public void addTopRow() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X, this.currentSim.Y + 1, this.currentSim.Z); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i, j, k) == BlockType.AIR) { continue; } _newSim.SetBlock(i, j + 1, k, currentSim.GetBlockType(i, j, k)); } } } DisplaySize = new Size((int)((currentSim.X * 9 + 1) * scale), (int)((currentSim.Y * 9 + 1) * scale)); SetUpInternalDisplay(_newSim); }
public void addTopRow() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X, this.currentSim.Y + 1, this.currentSim.Z); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i,j,k) == BlockType.AIR) continue; _newSim.SetBlock(i, j + 1, k, currentSim.GetBlockType(i,j,k)); } } } DisplaySize = new Size((int)((currentSim.X * 9 + 1) * scale), (int)((currentSim.Y * 9 + 1) * scale)); SetUpInternalDisplay(_newSim); }
public void addRightColumn() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X + 1, this.currentSim.Y, this.currentSim.Z); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i, j, k) == BlockType.AIR) continue; _newSim.SetBlock(i, j, k, currentSim.GetBlockType(i, j, k)); } } } SetUpInternalDisplay(_newSim); }
public void AddLayer() { //create new Simulation with Y+1 rows BlockSim _newSim = new BlockSim(this.currentSim.X, this.currentSim.Y, this.currentSim.Z+1); for (int i = 0; i < currentSim.X; i++) { for (int j = 0; j < currentSim.Y; j++) { for (int k = 0; k < currentSim.Z; k++) { if (currentSim.GetBlockType(i, j, k) == BlockType.AIR) continue; _newSim.SetBlock(i, j, k, currentSim.GetBlockType(i, j, k)); } } } _newSim.setAllConnections(); SetUpInternalDisplay(_newSim); }