Skill.cpp
Opened this issue · 3 comments
Verifiable commented
The switch case in Skill.cpp is gross.
Whales commented
Ok. Any alternative suggestions?
Verifiable commented
Just a normal switch case without any bizarre syntax changes.
Whales commented
It's pretty standard to write a switch like this for a function that has a 1:1 relationship between its single parameter and its return value.
For me it's a lot more readable to inline it than to break stuff out:
switch (type) {
case SKILL_MELEE: return "melee";
case SKILL_BASH: return "bashing_weapons";
}
is far nicer & more readable than
switch (type) {
case SKILL_MELEE:
return "melee";
break;
case SKILL_BASH:
return "bashing_weapons";
break;
}
in my opinion.