refac: LazyVarUpdater의 key로 BackedEnum 허용

This commit is contained in:
2022-08-26 00:34:39 +09:00
parent ed3e013a53
commit 16fb782bbf
2 changed files with 49 additions and 13 deletions
+4 -1
View File
@@ -44,7 +44,10 @@ class WarUnitCity extends WarUnit{
return $this->getVar('name');
}
function getCityVar(string $key){
function getCityVar(string|\BackedEnum $key){
if($key instanceof \BackedEnum){
$key = $key->value;
}
return $this->raw[$key];
}