public bool MoveDown(Field field, out SearchNode sn) { Vector2Int newPos = mino.position; Mino tmp = mino.Clone(); bool ok = false; newPos.y--; if (field.IsValid(mino, newPos)) { tmp.Fall(); ok = true; } sn = new SearchNode(tmp, op + "d"); return(ok); }
public int Fall() { Vector2Int newPosition = activeMino.GetPosition(); newPosition.y -= 1; if (field.IsValid(activeMino, activeMino.GetRotationId(), newPosition)) { activeMino.Fall(); operation += "d"; return(0); } else { return(-1); } }
public bool HardDrop(Field field, out SearchNode sn) { Vector2Int newPos = mino.position; Mino tmp = mino.Clone(); bool ok = false; newPos.y--; string hd = ""; while (field.IsValid(mino, newPos)) { tmp.Fall(); hd += "d"; ok = true; newPos.y--; } sn = new SearchNode(tmp, op + hd); return(ok); }