From 014fb9408e0c438fcfca1c5855d9748f2f051a55 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 4 May 2020 20:37:23 +0900 Subject: [PATCH] =?UTF-8?q?MinCondition=20=EC=A1=B0=EA=B1=B4=20=EC=95=BD?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/BaseCommand.php | 5 +---- hwe/sammo/Command/General/che_사기진작.php | 6 ++++++ hwe/sammo/Command/General/che_출병.php | 2 +- hwe/sammo/Command/General/che_훈련.php | 6 ++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/hwe/sammo/Command/BaseCommand.php b/hwe/sammo/Command/BaseCommand.php index df37be42..d1a5e749 100644 --- a/hwe/sammo/Command/BaseCommand.php +++ b/hwe/sammo/Command/BaseCommand.php @@ -312,10 +312,7 @@ abstract class BaseCommand{ } public function testMinConditionMet():?string{ - if(!static::$reqArg){ - if($this->minConditionConstraints){ - throw new \LogicException('reqArg==false인데 minCondition이 설정됨'); - } + if(!static::$reqArg && !$this->minConditionConstraints){ return $this->testFullConditionMet(); } diff --git a/hwe/sammo/Command/General/che_사기진작.php b/hwe/sammo/Command/General/che_사기진작.php index f9d7f425..15e8b5d6 100644 --- a/hwe/sammo/Command/General/che_사기진작.php +++ b/hwe/sammo/Command/General/che_사기진작.php @@ -35,6 +35,12 @@ class che_사기진작 extends Command\GeneralCommand{ $this->setNation(); [$reqGold, $reqRice] = $this->getCost(); + + $this->minConditionConstraints=[ + ConstraintHelper::NotBeNeutral(), + ConstraintHelper::NotWanderingNation(), + ConstraintHelper::OccupiedCity(), + ]; $this->fullConditionConstraints=[ ConstraintHelper::NotBeNeutral(), diff --git a/hwe/sammo/Command/General/che_출병.php b/hwe/sammo/Command/General/che_출병.php index 93216d44..b688d8bb 100644 --- a/hwe/sammo/Command/General/che_출병.php +++ b/hwe/sammo/Command/General/che_출병.php @@ -60,7 +60,7 @@ class che_출병 extends Command\GeneralCommand $relYear = $this->env['year'] - $this->env['startyear']; $this->minConditionConstraints = [ - ConstraintHelper::NotOpeningPart($relYear+1), + ConstraintHelper::NotOpeningPart($relYear+2), ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity(), ConstraintHelper::ReqGeneralCrew(), diff --git a/hwe/sammo/Command/General/che_훈련.php b/hwe/sammo/Command/General/che_훈련.php index 4da78026..05432f6c 100644 --- a/hwe/sammo/Command/General/che_훈련.php +++ b/hwe/sammo/Command/General/che_훈련.php @@ -34,6 +34,12 @@ class che_훈련 extends Command\GeneralCommand{ $this->setCity(); $this->setNation(); + + $this->minConditionConstraints=[ + ConstraintHelper::NotBeNeutral(), + ConstraintHelper::NotWanderingNation(), + ConstraintHelper::OccupiedCity(), + ]; $this->fullConditionConstraints=[ ConstraintHelper::NotBeNeutral(),