Command 구조 일부 수정
This commit is contained in:
@@ -63,10 +63,10 @@ abstract class BaseCommand{
|
||||
$this->reasonNotReservable = null;
|
||||
}
|
||||
|
||||
protected function setCity(array $args=null){
|
||||
protected function setCity(?array $args=null){
|
||||
$this->resetTestCache();
|
||||
$db = DB::db();
|
||||
if($args == null){
|
||||
if($args === null){
|
||||
$this->city = $this->generalObj->getRawCity();
|
||||
if($this->city){
|
||||
return;
|
||||
@@ -83,7 +83,7 @@ abstract class BaseCommand{
|
||||
|
||||
protected function setNation(?array $args = null){
|
||||
$this->resetTestCache();
|
||||
if($args == null){
|
||||
if($args === null){
|
||||
$this->nation = $this->generalObj->getStaticNation();
|
||||
return;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ abstract class BaseCommand{
|
||||
$constraintInput = [
|
||||
'general'=>$this->generalObj->getRaw(),
|
||||
'city'=>$this->city,
|
||||
'nation'=>$this->city,
|
||||
'nation'=>$this->nation,
|
||||
'arg'=>$this->arg,
|
||||
|
||||
'destGeneral'=>$this->destGeneral,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -11,6 +11,7 @@ use \sammo\{
|
||||
uniqueItemEx
|
||||
};
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use function sammo\CriticalScore;
|
||||
use function sammo\uniqueItemEx;
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -11,13 +11,14 @@ use \sammo\{
|
||||
uniqueItemEx
|
||||
};
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use function sammo\CriticalScore;
|
||||
use function sammo\uniqueItemEx;
|
||||
use function sammo\getGeneralLeadership;
|
||||
|
||||
|
||||
class che_상업투자 extends BaseCommand{
|
||||
class che_상업투자 extends GeneralCommand{
|
||||
static $cityKey = 'comm';
|
||||
static $statKey = 'intel';
|
||||
static $actionKey = '상업';
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -11,13 +11,14 @@ use \sammo\{
|
||||
uniqueItemEx
|
||||
};
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use function sammo\CriticalScore;
|
||||
use function sammo\uniqueItemEx;
|
||||
use function sammo\getGeneralLeadership;
|
||||
|
||||
|
||||
class che_상업투자 extends BaseCommand{
|
||||
class che_상업투자 extends GeneralCommand{
|
||||
static $cityKey = 'pop';
|
||||
static $statKey = 'leader';
|
||||
static $actionKey = '인구';
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -11,13 +11,14 @@ use \sammo\{
|
||||
uniqueItemEx
|
||||
};
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use function sammo\CriticalScore;
|
||||
use function sammo\uniqueItemEx;
|
||||
use function sammo\getGeneralLeadership;
|
||||
|
||||
|
||||
class che_주민선정 extends BaseCommand{
|
||||
class che_주민선정 extends GeneralCommand{
|
||||
static $cityKey = 'trust';
|
||||
static $statKey = 'leader';
|
||||
static $actionKey = '민심';
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\GeneralCommand;
|
||||
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
|
||||
class 휴식 extends BaseCommand{
|
||||
class 휴식 extends GeneralCommand{
|
||||
protected function init(){
|
||||
//아무것도 하지 않음
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
|
||||
abstract class GeneralCommand extends BaseCommand{
|
||||
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace sammo\Command\Nation;
|
||||
|
||||
use \sammo\Command;
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
|
||||
class 휴식 extends NationCommand{
|
||||
protected function init(){
|
||||
//아무것도 하지 않음
|
||||
}
|
||||
|
||||
protected function argTest():bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getCost():array{
|
||||
return [0, 0];
|
||||
}
|
||||
|
||||
public function run():bool{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo\Command;
|
||||
|
||||
abstract class NationCommand extends BaseCommand{
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user