I have to use the same switch case repeatedly in different functions. In different functions, the switch case definition will be different. For example:
int groupID = somenumber;
private void FunctionA()
{
switch (groupID)
{
case 0:
// Do Action A
break;
case 1:
// Do Action B
break;
case 2:
// Do Action C
break;
}
}
private void FunctionB()
{
switch (groupID)
{
case 0:
// Do Action Z
break;
case 1:
// Do Action X
break;
case 2:
// Do Action Y
break;
}
}
Is that any method to use the same switch case once time but the definition can be different?