커맨드 유효성을 2개에서 3개구성으로 변경

This commit is contained in:
2020-05-04 19:51:11 +09:00
parent dbba6fa942
commit 76ac6cf5b5
100 changed files with 4124 additions and 3420 deletions
+5 -6
View File
@@ -28,7 +28,6 @@ use sammo\Event\Action;
class che_증축 extends Command\NationCommand{
static protected $actionName = '증축';
static public $reqArg = false;
protected function argTest():bool{
$this->arg = [];
@@ -42,10 +41,10 @@ class che_증축 extends Command\NationCommand{
$env = $this->env;
if($general->getNationID()===0){
$this->reservableConstraints=[
$this->permissionConstraints=[
ConstraintHelper::NotBeNeutral(),
];
$this->runnableConstraints=[
$this->fullConditionConstraints=[
ConstraintHelper::NotBeNeutral(),
];
return;
@@ -53,11 +52,11 @@ class che_증축 extends Command\NationCommand{
$this->setCity();
$this->setNation(['gold', 'rice', 'capset', 'capital']);
$this->setDestCity($this->nation['capital'], null);
$this->setDestCity($this->nation['capital']);
[$reqGold, $reqRice] = $this->getCost();
$this->runnableConstraints=[
$this->fullConditionConstraints=[
ConstraintHelper::OccupiedCity(),
ConstraintHelper::BeChief(),
ConstraintHelper::SuppliedCity(),
@@ -135,7 +134,7 @@ class che_증축 extends Command\NationCommand{
}
public function run():bool{
if(!$this->isRunnable()){
if(!$this->hasFullConditionMet()){
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}