버그 수정

This commit is contained in:
2019-04-21 16:57:05 +09:00
parent 186df66e81
commit da5fc417c5
60 changed files with 73 additions and 68 deletions
+4 -3
View File
@@ -235,7 +235,7 @@ abstract class BaseCommand{
public function testReservable():?string{ public function testReservable():?string{
if($this->reservableConstraints === null){ if($this->reservableConstraints === null){
return true; return null;
} }
if($this->reasonNotReservable){ if($this->reasonNotReservable){
@@ -284,7 +284,7 @@ abstract class BaseCommand{
'nation'=>$this->nation, 'nation'=>$this->nation,
'arg'=>$this->arg, 'arg'=>$this->arg,
'destGeneral'=>$this->destGeneralObj->getRaw(), 'destGeneral'=>$this->destGeneralObj?$this->destGeneralObj->getRaw():null,
'destCity'=>$this->destCity, 'destCity'=>$this->destCity,
'destNation'=>$this->destNation, 'destNation'=>$this->destNation,
]; ];
@@ -300,7 +300,8 @@ abstract class BaseCommand{
return $this->reservable; return $this->reservable;
} }
return $this->testReservable() === null; $this->reservable = $this->testReservable() === null;
return $this->reservable;
} }
public function isArgValid():bool{ public function isArgValid():bool{
+1 -1
View File
@@ -7,7 +7,7 @@ namespace sammo\Constraint;
class AdhocCallback extends Constraint{ class AdhocCallback extends Constraint{
const REQ_VALUES = Constraint::REQ_ARG; const REQ_VALUES = Constraint::REQ_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -6,7 +6,7 @@ use \sammo\GameConst;
class AllowJoinAction extends Constraint{ class AllowJoinAction extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -9,7 +9,7 @@ class AllowJoinDestNation extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -10,7 +10,7 @@ use \sammo\MustNotBeReachedException;
class AllowRebellion extends Constraint{ class AllowRebellion extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class AllowWar extends Constraint{ class AllowWar extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION; const REQ_VALUES = Constraint::REQ_NATION;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class AllowWar extends Constraint{ class AllowWar extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION; const REQ_VALUES = Constraint::REQ_NATION;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -7,7 +7,7 @@ namespace sammo\Constraint;
class AlwaysFail extends Constraint{ class AlwaysFail extends Constraint{
const REQ_VALUES = Constraint::REQ_STRING_ARG; const REQ_VALUES = Constraint::REQ_STRING_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -8,7 +8,7 @@ use \sammo\DB;
class AvailableRecruitCrewType extends Constraint{ class AvailableRecruitCrewType extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_INT_ARG; const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_INT_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -6,7 +6,7 @@ use \sammo\DB;
class BattleGroundCity extends Constraint{ class BattleGroundCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY|Constraint::REQ_BOOLEAN_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY|Constraint::REQ_BOOLEAN_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class BeChief extends Constraint{ class BeChief extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class BeLord extends Constraint{ class BeLord extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class BeNeutral extends Constraint{ class BeNeutral extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -7,7 +7,7 @@ class BeOpeningPart extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -8,7 +8,7 @@ class CheckNationNameDuplicate extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+10 -8
View File
@@ -77,7 +77,7 @@ abstract class Constraint{
$this->reason = null; $this->reason = null;
} }
static public function build(array $input):this{ static public function build(array $input):self{
$self = new static(); $self = new static();
foreach($input as $key=>$value){ foreach($input as $key=>$value){
if($value === null){ if($value === null){
@@ -140,27 +140,27 @@ abstract class Constraint{
throw new \InvalidArgumentException('require arg'); throw new \InvalidArgumentException('require arg');
} }
if(($valueType&static::REQ_STRING_ARG) && !is_string($this->arg)){ if(($valueType&static::REQ_STRING_ARG===static::REQ_STRING_ARG) && !is_string($this->arg)){
if(!$throwExeception){return false; } if(!$throwExeception){return false; }
throw new \InvalidArgumentException('require string arg'); throw new \InvalidArgumentException('require string arg');
} }
if(($valueType&static::REQ_BOOLEAN_ARG) && !is_bool($this->arg)){ if(($valueType&static::REQ_BOOLEAN_ARG===static::REQ_BOOLEAN_ARG) && !is_bool($this->arg)){
if(!$throwExeception){return false; } if(!$throwExeception){return false; }
throw new \InvalidArgumentException('require bool arg'); throw new \InvalidArgumentException('require bool arg');
} }
if(($valueType&static::REQ_INT_ARG) && !is_int($this->arg)){ if(($valueType&static::REQ_INT_ARG===static::REQ_INT_ARG) && !is_int($this->arg)){
if(!$throwExeception){return false; } if(!$throwExeception){return false; }
throw new \InvalidArgumentException('require int arg'); throw new \InvalidArgumentException('require int arg');
} }
if(($valueType&static::REQ_NUMERIC_ARG) && !is_numeric($this->arg)){ if(($valueType&static::REQ_NUMERIC_ARG===static::REQ_NUMERIC_ARG) && !is_numeric($this->arg)){
if(!$throwExeception){return false; } if(!$throwExeception){return false; }
throw new \InvalidArgumentException('require numeric arg'); throw new \InvalidArgumentException('require numeric arg');
} }
if(!($valueType&static::REQ_ARRAY_ARG) && !is_array($this->arg)){ if(($valueType&static::REQ_ARRAY_ARG===static::REQ_ARRAY_ARG) && !is_array($this->arg)){
if(!$throwExeception){return false; } if(!$throwExeception){return false; }
throw new \InvalidArgumentException('require array arg'); throw new \InvalidArgumentException('require array arg');
} }
@@ -170,7 +170,7 @@ abstract class Constraint{
public function reason():?string{ public function reason():?string{
if(!$this->tested === false){ if(!$this->tested === false){
throw new \RuntimeException('test가 실행되지 않음'); throw new \RuntimeException(get_class($this).'::test가 실행되지 않음');
} }
return $this->reason; return $this->reason;
} }
@@ -181,10 +181,12 @@ abstract class Constraint{
continue; continue;
} }
$method = $constraintArgs[0].'::build'; $method = __NAMESPACE__.'\\'.$constraintArgs[0].'::build';
/** @var \sammo\Constraint\Constraint $contraint */ /** @var \sammo\Constraint\Constraint $contraint */
$constraint = call_user_func($method,$input); $constraint = call_user_func($method,$input);
assert($constraint instanceof Constraint);
if(count($constraintArgs) > 1){ if(count($constraintArgs) > 1){
$arg = $constraintArgs[1]; $arg = $constraintArgs[1];
+1 -1
View File
@@ -7,7 +7,7 @@ class ConstructableCity extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class DifferentNationDestGeneral extends Constraint{ class DifferentNationDestGeneral extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -11,7 +11,7 @@ class DisallowDiplomacyBetweenStatus extends Constraint{
protected $destNationID; protected $destNationID;
protected $disallowStatus = []; protected $disallowStatus = [];
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -10,7 +10,7 @@ class DisallowDiplomacyStatus extends Constraint{
protected $nationID; protected $nationID;
protected $disallowStatus = []; protected $disallowStatus = [];
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -9,7 +9,7 @@ class AllowJoinDestNation extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ExistsDestGeneral extends Constraint{ class ExistsDestGeneral extends Constraint{
const REQ_VALUES = Constraint::REQ_DEST_GENERAL; const REQ_VALUES = Constraint::REQ_DEST_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ExistsDestNation extends Constraint{ class ExistsDestNation extends Constraint{
const REQ_VALUES = Constraint::REQ_DEST_NATION; const REQ_VALUES = Constraint::REQ_DEST_NATION;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class FriendlyDestGeneral extends Constraint{ class FriendlyDestGeneral extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -4,7 +4,7 @@ namespace sammo\Constraint;
class MustBeNPC extends Constraint{ class MustBeNPC extends Constraint{
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -7,7 +7,7 @@ use sammo\DB;
class MustBeTroopLeader extends Constraint{ class MustBeTroopLeader extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NearCity extends Constraint{ class NearCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY|Constraint::REQ_NUMERIC_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY|Constraint::REQ_NUMERIC_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotBeNeutral extends Constraint{ class NotBeNeutral extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotCapital extends Constraint{ class NotCapital extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NATION|Constraint::REQ_BOOLEAN_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NATION|Constraint::REQ_BOOLEAN_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotChief extends Constraint{ class NotChief extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotLord extends Constraint{ class NotLord extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotBeNeutral extends Constraint{ class NotBeNeutral extends Constraint{
const REQ_VALUES = Constraint::REQ_DEST_CITY; const REQ_VALUES = Constraint::REQ_DEST_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotOccupiedDestCity extends Constraint{ class NotOccupiedDestCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -7,7 +7,7 @@ class NotOpeningPart extends Constraint{
protected $relYear; protected $relYear;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotSameDestCity extends Constraint{ class NotSameDestCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class NotWanderingNation extends Constraint{ class NotWanderingNation extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION; const REQ_VALUES = Constraint::REQ_NATION;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class OccupiedCity extends Constraint{ class OccupiedCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_CITY|Constraint::REQ_BOOLEAN_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_CITY|Constraint::REQ_BOOLEAN_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class OccupiedDestCity extends Constraint{ class OccupiedDestCity extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_DEST_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -11,7 +11,7 @@ class RemainCityCapacity extends Constraint{
protected $maxKey; protected $maxKey;
protected $keyNick; protected $keyNick;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -11,7 +11,7 @@ class RemainCityTrust extends Constraint{
protected $maxKey; protected $maxKey;
protected $keyNick; protected $keyNick;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -13,7 +13,7 @@ class ReqCityCapacity extends Constraint{
protected $keyNick; protected $keyNick;
protected $reqVal; protected $reqVal;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqCityTrader extends Constraint{ class ReqCityTrader extends Constraint{
const REQ_VALUES = Constraint::REQ_CITY|Constraint::REQ_INT_ARG; const REQ_VALUES = Constraint::REQ_CITY|Constraint::REQ_INT_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -11,7 +11,7 @@ class RemainCityTrust extends Constraint{
protected $maxKey; protected $maxKey;
protected $keyNick; protected $keyNick;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ class ReqEnvValue extends Constraint{
protected $comp; protected $comp;
protected $msg; protected $msg;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -6,7 +6,7 @@ use sammo\GameConst;
class ReqGeneralAtmosMargin extends Constraint{ class ReqGeneralAtmosMargin extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqGeneralCrew extends Constraint{ class ReqGeneralCrew extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -10,7 +10,7 @@ class ReqGeneralCrewMargin extends Constraint{
protected $crewType; protected $crewType;
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqGeneralGold extends Constraint{ class ReqGeneralGold extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NUMERIC_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NUMERIC_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqGeneralRice extends Constraint{ class ReqGeneralRice extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NUMERIC_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_NUMERIC_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
@@ -6,7 +6,7 @@ use sammo\GameConst;
class ReqGeneralTrainMargin extends Constraint{ class ReqGeneralTrainMargin extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG; const REQ_VALUES = Constraint::REQ_GENERAL|Constraint::REQ_INT_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ class ReqGeneralValue extends Constraint{
protected $reqVal; protected $reqVal;
protected $comp; protected $comp;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ class ReqNationValue extends Constraint{
protected $reqVal; protected $reqVal;
protected $comp; protected $comp;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqNationGold extends Constraint{ class ReqNationGold extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_NUMERIC_ARG; const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_NUMERIC_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class ReqNationRice extends Constraint{ class ReqNationRice extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_NUMERIC_ARG; const REQ_VALUES = Constraint::REQ_NATION|Constraint::REQ_NUMERIC_ARG;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -6,7 +6,7 @@ use sammo\DB;
class ReqTroopMembers extends Constraint{ class ReqTroopMembers extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL; const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class SuppliedCity extends Constraint{ class SuppliedCity extends Constraint{
const REQ_VALUES = Constraint::REQ_CITY; const REQ_VALUES = Constraint::REQ_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class SuppliedDestCity extends Constraint{ class SuppliedDestCity extends Constraint{
const REQ_VALUES = Constraint::REQ_DEST_CITY; const REQ_VALUES = Constraint::REQ_DEST_CITY;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ namespace sammo\Constraint;
class WanderingNation extends Constraint{ class WanderingNation extends Constraint{
const REQ_VALUES = Constraint::REQ_NATION; const REQ_VALUES = Constraint::REQ_NATION;
public function checkInputValues(bool $throwExeception=true){ public function checkInputValues(bool $throwExeception=true):bool{
if(!parent::checkInputValues($throwExeception) && !$throwExeception){ if(!parent::checkInputValues($throwExeception) && !$throwExeception){
return false; return false;
} }
+1
View File
@@ -989,6 +989,7 @@ class GeneralAI{
$db = DB::db(); $db = DB::db();
$arg = null;
// 오랑캐는 바로 임관 // 오랑캐는 바로 임관
if($general->getVar('npc') == 9) { if($general->getVar('npc') == 9) {
@@ -1,5 +1,6 @@
<?php <?php
namespace sammo\TextDecoration; namespace sammo\TextDecoration;
use \sammo\Util;
class SightseeingMessage{ class SightseeingMessage{
@@ -98,7 +99,7 @@ class SightseeingMessage{
{ {
//TODO: 장수 이름이 들어가는 경우도 고려? //TODO: 장수 이름이 들어가는 경우도 고려?
if(static::$messages === null){ if(static::$messages === null){
static::buildMessageList(); static::initMessageList();
} }
} }