Util/Enums

* create helper enum classes ChrClass & ChrRace
 * replace various iterators and checks with said enums
This commit is contained in:
Sarjuuk
2022-04-05 16:51:59 +02:00
parent a5bd6ddc8a
commit 1f59e6fe2d
34 changed files with 642 additions and 595 deletions

View File

@@ -510,7 +510,7 @@ class AjaxProfile extends AjaxHandler
'level' => $pBase['level'],
'classs' => $pBase['class'],
'race' => $pBase['race'],
'faction' => Game::sideByRaceMask(1 << ($pBase['race'] - 1)) - 1,
'faction' => ChrRace::tryFrom($pBase['race'])?->getSide() ?? SIDE_NONE,
'gender' => $pBase['gender'],
'skincolor' => $pBase['skincolor'],
'hairstyle' => $pBase['hairstyle'],