턴 수행 constraint를 상세하게 분리, argTest 추가. 턴 커맨드 실행용 클래스, ajax 파일 준비

This commit is contained in:
2018-09-16 22:16:08 +09:00
parent 0dfd010685
commit f919e6eb43
14 changed files with 164 additions and 38 deletions
+6 -2
View File
@@ -33,7 +33,7 @@ class che_주민선정 extends BaseCommand{
$develCost = $this->env['develcost'] * 2;
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $reqGold);
$this->constraints=[
$this->runnableConstraints=[
['NoNeutral'],
['NoWanderingNation'],
['OccupiedCity'],
@@ -45,6 +45,10 @@ class che_주민선정 extends BaseCommand{
$this->reqRice = $reqRice;
}
protected function argTest():bool{
return true;
}
protected function calcBaseScore():float{
$general = $this->generalObj;
@@ -64,7 +68,7 @@ class che_주민선정 extends BaseCommand{
}
public function run():bool{
if(!$this->isAvailable()){
if(!$this->isRunnable()){
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}