Is there a way to merge switch
statements from two different classes, both with the same function name, into one without manually overriding the function or copying and pasting code?
Class A:
protected casesHandler(): void
{
switch (case){
case 0:
break;
default:
super.caseHandler();
}
}
Class B:
protected casesHandler(): void
{
switch (case){
case 1:
break;
default:
super.caseHandler();
}
}
desired outcome:
protected casesHandler(): void
{
switch (case){
case 0:
break;
case 1:
break;
default:
super.caseHandler();
}
}
attempting to avoid:
protected casesHandler(): void
{
switch (case){
case 0:
break;
default:
super.caseHandler();
}
switch (case){
case 1:
break;
default:
super.caseHandler();
}
}