턴 수행 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'];
$reqGold = $general->onCalcDomestic(static::$actionKey, 'cost', $reqGold);
$this->constraints=[
$this->runnableConstraints=[
['NoNeutral'],
['NoWanderingNation'],
['OccupiedCity'],
@@ -45,6 +45,10 @@ class che_상업투자 extends BaseCommand{
$this->reqGold = $reqGold;
}
protected function argTest():bool{
return true;
}
protected function calcBaseScore():float{
$trust = Util::valueFit($this->city['trust'], 50);
$general = $this->generalObj;
@@ -71,7 +75,7 @@ class che_상업투자 extends BaseCommand{
}
public function run():bool{
if(!$this->isAvailable()){
if(!$this->isRunnable()){
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}