public bool mino_lock(ref board field) { if (!check_mino_ok(ref field, minopos)) { return(false); } soft_drop_floor(ref field); for (int i = 0; i < height; i++) { for (int j = weight - 1; j >= 0; --j) { if (minofield[j, i] != 0) { field.column_height[i + minopos.y] = Math.Max(field.column_height[i + minopos.y], minopos.x + j + 1); break; } } } spinstatupdate(ref field); for (int i = 0; i < height; ++i) { for (int j = 0; j < weight; ++j) { if (minofield[i, j] != 0) { field.field[i + minopos.x, j + minopos.y] = 1; } } } locked = true; //if (minopos.x >= 20) return false; return(true); } // 不锁定判断tspin
public int left_rotation(ref board field) { int kick_try = 0; int a = height, b = weight; int[,] newfield = new int[a, b]; left_roll(ref newfield); for (int kick = 0; kick < kicktable.GetLength(1); ++kick) { if (!check_mino_ok(ref field, minopos.x - kicktable[(stat + 3) % 4, kick].y, minopos.y - kicktable[(stat + 3) % 4, kick].x, newfield)) { kick_try += 1; } else { minopos.x -= kicktable[(stat + 3) % 4, kick].y; minopos.y -= kicktable[(stat + 3) % 4, kick].x; break; } } if (kick_try > 4) { return(-1); } stat += 3; stat %= 4; for (int i = 0; i < a; ++i) { for (int j = 0; j < b; ++j) { minofield[i, j] = newfield[i, j]; } } spinlast = true; return(kick_try); }