考虑代码:
private String mode; // current played mode
private void func(int row , int column)
{
// rotation mode
if ((row == 0 && column == 0) || (row == 2 && column == 0) || (row == 0 && column == 2) || (row == 2 && column == 2))
{
mode = ROTATE_MODE;
}
// scaling more
else if ((row == 0 && column == 1) || (row == 1 && column == 0) || (row == 2 && column == 1) || (row == 1 && column == 2))
{
mode = SCALE_MODE;
}
// translate mode
else if ((row == 1 && column == 1))
{
mode = TRANSLATE_MODE;
}
}
如何将 Switch-case 用于row
and column
?