feat, refac(wip): 징병 기준을 GameUnitConstraint 기반으로 변경
This commit is contained in:
@@ -56,7 +56,11 @@ class GameUnitDetail implements iAction
|
||||
$this->magicCoef = $magicCoef;
|
||||
$this->cost = $cost;
|
||||
$this->rice = $rice;
|
||||
$this->reqConstraints = $reqConstraints;
|
||||
$this->reqConstraints = [];
|
||||
foreach($reqConstraints as $constraint){
|
||||
$className = Util::getClassNameFromObj($constraint);
|
||||
$this->reqConstraints[$className] = $constraint;
|
||||
}
|
||||
$this->attackCoef = $attackCoef;
|
||||
$this->defenceCoef = $defenceCoef;
|
||||
$this->initSkillTrigger = $initSkillTrigger;
|
||||
@@ -205,36 +209,6 @@ class GameUnitDetail implements iAction
|
||||
}
|
||||
}
|
||||
|
||||
if ($tech < $this->reqTech) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->reqCities !== null) {
|
||||
$valid = false;
|
||||
foreach ($this->reqCities as $reqCity) {
|
||||
if (\key_exists($reqCity, $ownCities)) {
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->reqRegions !== null) {
|
||||
$valid = false;
|
||||
foreach ($this->reqRegions as $reqRegion) {
|
||||
if (\key_exists($reqRegion, $ownRegions)) {
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user