From 16fed754a948a5b2405963be27054dcb1a9c6dd1 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 21 Apr 2019 16:57:05 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/BaseCommand.php | 7 ++++--- hwe/sammo/Constraint/AdhocCallback.php | 2 +- hwe/sammo/Constraint/AllowJoinAction.php | 2 +- hwe/sammo/Constraint/AllowJoinDestNation.php | 2 +- hwe/sammo/Constraint/AllowRebellion.php | 2 +- hwe/sammo/Constraint/AllowStrategicCommand.php | 2 +- hwe/sammo/Constraint/AllowWar.php | 2 +- hwe/sammo/Constraint/AlwaysFail.php | 2 +- .../Constraint/AvailableRecruitCrewType.php | 2 +- hwe/sammo/Constraint/BattleGroundCity.php | 2 +- hwe/sammo/Constraint/BeChief.php | 2 +- hwe/sammo/Constraint/BeLord.php | 2 +- hwe/sammo/Constraint/BeNeutral.php | 2 +- hwe/sammo/Constraint/BeOpeningPart.php | 2 +- .../Constraint/CheckNationNameDuplicate.php | 2 +- hwe/sammo/Constraint/Constraint.php | 18 ++++++++++-------- hwe/sammo/Constraint/ConstructableCity.php | 2 +- .../Constraint/DifferentNationDestGeneral.php | 2 +- .../DisallowDiplomacyBetweenStatus.php | 2 +- .../Constraint/DisallowDiplomacyStatus.php | 2 +- hwe/sammo/Constraint/ExistsAllowJoinNation.php | 2 +- hwe/sammo/Constraint/ExistsDestGeneral.php | 2 +- hwe/sammo/Constraint/ExistsDestNation.php | 2 +- hwe/sammo/Constraint/FriendlyDestGeneral.php | 2 +- hwe/sammo/Constraint/MustBeNPC.php | 2 +- hwe/sammo/Constraint/MustBeTroopLeader.php | 2 +- hwe/sammo/Constraint/NearCity.php | 2 +- hwe/sammo/Constraint/NotBeNeutral.php | 2 +- hwe/sammo/Constraint/NotCapital.php | 2 +- hwe/sammo/Constraint/NotChief.php | 2 +- hwe/sammo/Constraint/NotLord.php | 2 +- hwe/sammo/Constraint/NotNeutralDestCity.php | 2 +- hwe/sammo/Constraint/NotOccupiedDestCity.php | 2 +- hwe/sammo/Constraint/NotOpeningPart.php | 2 +- hwe/sammo/Constraint/NotSameDestCity.php | 2 +- hwe/sammo/Constraint/NotWanderingNation.php | 2 +- hwe/sammo/Constraint/OccupiedCity.php | 2 +- hwe/sammo/Constraint/OccupiedDestCity.php | 2 +- hwe/sammo/Constraint/RemainCityCapacity.php | 2 +- hwe/sammo/Constraint/RemainCityTrust.php | 2 +- hwe/sammo/Constraint/ReqCityCapacity.php | 2 +- hwe/sammo/Constraint/ReqCityTrader.php | 2 +- hwe/sammo/Constraint/ReqCityTrust.php | 2 +- hwe/sammo/Constraint/ReqEnvValue.php | 2 +- hwe/sammo/Constraint/ReqGeneralAtmosMargin.php | 2 +- hwe/sammo/Constraint/ReqGeneralCrew.php | 2 +- hwe/sammo/Constraint/ReqGeneralCrewMargin.php | 2 +- hwe/sammo/Constraint/ReqGeneralGold.php | 2 +- hwe/sammo/Constraint/ReqGeneralRice.php | 2 +- hwe/sammo/Constraint/ReqGeneralTrainMargin.php | 2 +- hwe/sammo/Constraint/ReqGeneralValue.php | 2 +- hwe/sammo/Constraint/ReqNationValue.php | 2 +- hwe/sammo/Constraint/ReqNationalGold.php | 2 +- hwe/sammo/Constraint/ReqNationalRice.php | 2 +- hwe/sammo/Constraint/ReqTroopMembers.php | 2 +- hwe/sammo/Constraint/SuppliedCity.php | 2 +- hwe/sammo/Constraint/SuppliedDestCity.php | 2 +- hwe/sammo/Constraint/WanderingNation.php | 2 +- hwe/sammo/GeneralAI.php | 1 + .../TextDecoration/SightseeingMessage.php | 3 ++- 60 files changed, 73 insertions(+), 68 deletions(-) diff --git a/hwe/sammo/Command/BaseCommand.php b/hwe/sammo/Command/BaseCommand.php index 5a97095b..f6093005 100644 --- a/hwe/sammo/Command/BaseCommand.php +++ b/hwe/sammo/Command/BaseCommand.php @@ -235,7 +235,7 @@ abstract class BaseCommand{ public function testReservable():?string{ if($this->reservableConstraints === null){ - return true; + return null; } if($this->reasonNotReservable){ @@ -284,7 +284,7 @@ abstract class BaseCommand{ 'nation'=>$this->nation, 'arg'=>$this->arg, - 'destGeneral'=>$this->destGeneralObj->getRaw(), + 'destGeneral'=>$this->destGeneralObj?$this->destGeneralObj->getRaw():null, 'destCity'=>$this->destCity, 'destNation'=>$this->destNation, ]; @@ -300,7 +300,8 @@ abstract class BaseCommand{ return $this->reservable; } - return $this->testReservable() === null; + $this->reservable = $this->testReservable() === null; + return $this->reservable; } public function isArgValid():bool{ diff --git a/hwe/sammo/Constraint/AdhocCallback.php b/hwe/sammo/Constraint/AdhocCallback.php index a627ee9d..cb9f1e16 100644 --- a/hwe/sammo/Constraint/AdhocCallback.php +++ b/hwe/sammo/Constraint/AdhocCallback.php @@ -7,7 +7,7 @@ namespace sammo\Constraint; class AdhocCallback extends Constraint{ const REQ_VALUES = Constraint::REQ_ARG; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AllowJoinAction.php b/hwe/sammo/Constraint/AllowJoinAction.php index 9e2a53ed..6c7ff96f 100644 --- a/hwe/sammo/Constraint/AllowJoinAction.php +++ b/hwe/sammo/Constraint/AllowJoinAction.php @@ -6,7 +6,7 @@ use \sammo\GameConst; class AllowJoinAction extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AllowJoinDestNation.php b/hwe/sammo/Constraint/AllowJoinDestNation.php index 4de94521..e7420cd5 100644 --- a/hwe/sammo/Constraint/AllowJoinDestNation.php +++ b/hwe/sammo/Constraint/AllowJoinDestNation.php @@ -9,7 +9,7 @@ class AllowJoinDestNation extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AllowRebellion.php b/hwe/sammo/Constraint/AllowRebellion.php index 0351c352..c654bf21 100644 --- a/hwe/sammo/Constraint/AllowRebellion.php +++ b/hwe/sammo/Constraint/AllowRebellion.php @@ -10,7 +10,7 @@ use \sammo\MustNotBeReachedException; class AllowRebellion extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AllowStrategicCommand.php b/hwe/sammo/Constraint/AllowStrategicCommand.php index d1eaf61f..b8beeebb 100644 --- a/hwe/sammo/Constraint/AllowStrategicCommand.php +++ b/hwe/sammo/Constraint/AllowStrategicCommand.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class AllowWar extends Constraint{ const REQ_VALUES = Constraint::REQ_NATION; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AllowWar.php b/hwe/sammo/Constraint/AllowWar.php index d1eaf61f..b8beeebb 100644 --- a/hwe/sammo/Constraint/AllowWar.php +++ b/hwe/sammo/Constraint/AllowWar.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class AllowWar extends Constraint{ const REQ_VALUES = Constraint::REQ_NATION; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/AlwaysFail.php b/hwe/sammo/Constraint/AlwaysFail.php index deea7e00..459f2112 100644 --- a/hwe/sammo/Constraint/AlwaysFail.php +++ b/hwe/sammo/Constraint/AlwaysFail.php @@ -7,7 +7,7 @@ namespace sammo\Constraint; class AlwaysFail extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/AvailableRecruitCrewType.php b/hwe/sammo/Constraint/AvailableRecruitCrewType.php index 2c74c40d..2486d46b 100644 --- a/hwe/sammo/Constraint/AvailableRecruitCrewType.php +++ b/hwe/sammo/Constraint/AvailableRecruitCrewType.php @@ -8,7 +8,7 @@ use \sammo\DB; class AvailableRecruitCrewType extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/BattleGroundCity.php b/hwe/sammo/Constraint/BattleGroundCity.php index eac3866f..ae6f0dd8 100644 --- a/hwe/sammo/Constraint/BattleGroundCity.php +++ b/hwe/sammo/Constraint/BattleGroundCity.php @@ -6,7 +6,7 @@ use \sammo\DB; class BattleGroundCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/BeChief.php b/hwe/sammo/Constraint/BeChief.php index b96328d0..d23594e6 100644 --- a/hwe/sammo/Constraint/BeChief.php +++ b/hwe/sammo/Constraint/BeChief.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class BeChief extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/BeLord.php b/hwe/sammo/Constraint/BeLord.php index a6ce1f3b..ba2756ae 100644 --- a/hwe/sammo/Constraint/BeLord.php +++ b/hwe/sammo/Constraint/BeLord.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class BeLord extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/BeNeutral.php b/hwe/sammo/Constraint/BeNeutral.php index 557f1b0a..a7cc3607 100644 --- a/hwe/sammo/Constraint/BeNeutral.php +++ b/hwe/sammo/Constraint/BeNeutral.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class BeNeutral extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/BeOpeningPart.php b/hwe/sammo/Constraint/BeOpeningPart.php index 2e156445..b649600b 100644 --- a/hwe/sammo/Constraint/BeOpeningPart.php +++ b/hwe/sammo/Constraint/BeOpeningPart.php @@ -7,7 +7,7 @@ class BeOpeningPart extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/CheckNationNameDuplicate.php b/hwe/sammo/Constraint/CheckNationNameDuplicate.php index 13653b7b..188df57e 100644 --- a/hwe/sammo/Constraint/CheckNationNameDuplicate.php +++ b/hwe/sammo/Constraint/CheckNationNameDuplicate.php @@ -8,7 +8,7 @@ class CheckNationNameDuplicate extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/Constraint.php b/hwe/sammo/Constraint/Constraint.php index f2c21a90..1cafb261 100644 --- a/hwe/sammo/Constraint/Constraint.php +++ b/hwe/sammo/Constraint/Constraint.php @@ -77,7 +77,7 @@ abstract class Constraint{ $this->reason = null; } - static public function build(array $input):this{ + static public function build(array $input):self{ $self = new static(); foreach($input as $key=>$value){ if($value === null){ @@ -140,27 +140,27 @@ abstract class Constraint{ 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; } 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; } 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; } 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; } 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; } throw new \InvalidArgumentException('require array arg'); } @@ -170,7 +170,7 @@ abstract class Constraint{ public function reason():?string{ if(!$this->tested === false){ - throw new \RuntimeException('test가 실행되지 않음'); + throw new \RuntimeException(get_class($this).'::test가 실행되지 않음'); } return $this->reason; } @@ -181,10 +181,12 @@ abstract class Constraint{ continue; } - $method = $constraintArgs[0].'::build'; + $method = __NAMESPACE__.'\\'.$constraintArgs[0].'::build'; /** @var \sammo\Constraint\Constraint $contraint */ $constraint = call_user_func($method,$input); + + assert($constraint instanceof Constraint); if(count($constraintArgs) > 1){ $arg = $constraintArgs[1]; diff --git a/hwe/sammo/Constraint/ConstructableCity.php b/hwe/sammo/Constraint/ConstructableCity.php index a73642f5..99914228 100644 --- a/hwe/sammo/Constraint/ConstructableCity.php +++ b/hwe/sammo/Constraint/ConstructableCity.php @@ -7,7 +7,7 @@ class ConstructableCity extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/DifferentNationDestGeneral.php b/hwe/sammo/Constraint/DifferentNationDestGeneral.php index 281c209e..8300fab9 100644 --- a/hwe/sammo/Constraint/DifferentNationDestGeneral.php +++ b/hwe/sammo/Constraint/DifferentNationDestGeneral.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class DifferentNationDestGeneral extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/DisallowDiplomacyBetweenStatus.php b/hwe/sammo/Constraint/DisallowDiplomacyBetweenStatus.php index 6a3a9e27..f5cf6cc0 100644 --- a/hwe/sammo/Constraint/DisallowDiplomacyBetweenStatus.php +++ b/hwe/sammo/Constraint/DisallowDiplomacyBetweenStatus.php @@ -11,7 +11,7 @@ class DisallowDiplomacyBetweenStatus extends Constraint{ protected $destNationID; protected $disallowStatus = []; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/DisallowDiplomacyStatus.php b/hwe/sammo/Constraint/DisallowDiplomacyStatus.php index fcfe6a01..ef14bca5 100644 --- a/hwe/sammo/Constraint/DisallowDiplomacyStatus.php +++ b/hwe/sammo/Constraint/DisallowDiplomacyStatus.php @@ -10,7 +10,7 @@ class DisallowDiplomacyStatus extends Constraint{ protected $nationID; protected $disallowStatus = []; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ExistsAllowJoinNation.php b/hwe/sammo/Constraint/ExistsAllowJoinNation.php index 65fb3687..e1f9e3ee 100644 --- a/hwe/sammo/Constraint/ExistsAllowJoinNation.php +++ b/hwe/sammo/Constraint/ExistsAllowJoinNation.php @@ -9,7 +9,7 @@ class AllowJoinDestNation extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ExistsDestGeneral.php b/hwe/sammo/Constraint/ExistsDestGeneral.php index 05eda6dc..712379ee 100644 --- a/hwe/sammo/Constraint/ExistsDestGeneral.php +++ b/hwe/sammo/Constraint/ExistsDestGeneral.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ExistsDestGeneral extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ExistsDestNation.php b/hwe/sammo/Constraint/ExistsDestNation.php index 9d0a7bf4..4e08e1e4 100644 --- a/hwe/sammo/Constraint/ExistsDestNation.php +++ b/hwe/sammo/Constraint/ExistsDestNation.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ExistsDestNation extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/FriendlyDestGeneral.php b/hwe/sammo/Constraint/FriendlyDestGeneral.php index 43d2350a..14a44b3f 100644 --- a/hwe/sammo/Constraint/FriendlyDestGeneral.php +++ b/hwe/sammo/Constraint/FriendlyDestGeneral.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class FriendlyDestGeneral extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/MustBeNPC.php b/hwe/sammo/Constraint/MustBeNPC.php index 885fdd60..1f075fb5 100644 --- a/hwe/sammo/Constraint/MustBeNPC.php +++ b/hwe/sammo/Constraint/MustBeNPC.php @@ -4,7 +4,7 @@ namespace sammo\Constraint; class MustBeNPC extends Constraint{ - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/MustBeTroopLeader.php b/hwe/sammo/Constraint/MustBeTroopLeader.php index 685036c9..c2a5abc7 100644 --- a/hwe/sammo/Constraint/MustBeTroopLeader.php +++ b/hwe/sammo/Constraint/MustBeTroopLeader.php @@ -7,7 +7,7 @@ use sammo\DB; class MustBeTroopLeader extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/NearCity.php b/hwe/sammo/Constraint/NearCity.php index 0fff8ac8..77e9bbea 100644 --- a/hwe/sammo/Constraint/NearCity.php +++ b/hwe/sammo/Constraint/NearCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NearCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/NotBeNeutral.php b/hwe/sammo/Constraint/NotBeNeutral.php index e95dbade..7f2aa391 100644 --- a/hwe/sammo/Constraint/NotBeNeutral.php +++ b/hwe/sammo/Constraint/NotBeNeutral.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotBeNeutral extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/NotCapital.php b/hwe/sammo/Constraint/NotCapital.php index 2725fe88..b21e92d4 100644 --- a/hwe/sammo/Constraint/NotCapital.php +++ b/hwe/sammo/Constraint/NotCapital.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotCapital extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/NotChief.php b/hwe/sammo/Constraint/NotChief.php index fde27dbd..003abbd9 100644 --- a/hwe/sammo/Constraint/NotChief.php +++ b/hwe/sammo/Constraint/NotChief.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotChief extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/NotLord.php b/hwe/sammo/Constraint/NotLord.php index a268629d..91826102 100644 --- a/hwe/sammo/Constraint/NotLord.php +++ b/hwe/sammo/Constraint/NotLord.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotLord extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/NotNeutralDestCity.php b/hwe/sammo/Constraint/NotNeutralDestCity.php index 1b576c06..fad4b1e9 100644 --- a/hwe/sammo/Constraint/NotNeutralDestCity.php +++ b/hwe/sammo/Constraint/NotNeutralDestCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotBeNeutral extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/NotOccupiedDestCity.php b/hwe/sammo/Constraint/NotOccupiedDestCity.php index e32092b9..0c8056a2 100644 --- a/hwe/sammo/Constraint/NotOccupiedDestCity.php +++ b/hwe/sammo/Constraint/NotOccupiedDestCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotOccupiedDestCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/NotOpeningPart.php b/hwe/sammo/Constraint/NotOpeningPart.php index 337d48d7..0b23e754 100644 --- a/hwe/sammo/Constraint/NotOpeningPart.php +++ b/hwe/sammo/Constraint/NotOpeningPart.php @@ -7,7 +7,7 @@ class NotOpeningPart extends Constraint{ protected $relYear; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/NotSameDestCity.php b/hwe/sammo/Constraint/NotSameDestCity.php index 7711498b..b66fc85f 100644 --- a/hwe/sammo/Constraint/NotSameDestCity.php +++ b/hwe/sammo/Constraint/NotSameDestCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotSameDestCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/NotWanderingNation.php b/hwe/sammo/Constraint/NotWanderingNation.php index 5b43756c..b84dadf3 100644 --- a/hwe/sammo/Constraint/NotWanderingNation.php +++ b/hwe/sammo/Constraint/NotWanderingNation.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class NotWanderingNation extends Constraint{ const REQ_VALUES = Constraint::REQ_NATION; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/OccupiedCity.php b/hwe/sammo/Constraint/OccupiedCity.php index 72ac4c69..967426fb 100644 --- a/hwe/sammo/Constraint/OccupiedCity.php +++ b/hwe/sammo/Constraint/OccupiedCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class OccupiedCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/OccupiedDestCity.php b/hwe/sammo/Constraint/OccupiedDestCity.php index efceccaf..854039c0 100644 --- a/hwe/sammo/Constraint/OccupiedDestCity.php +++ b/hwe/sammo/Constraint/OccupiedDestCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class OccupiedDestCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/RemainCityCapacity.php b/hwe/sammo/Constraint/RemainCityCapacity.php index f83c05ab..0908ed69 100644 --- a/hwe/sammo/Constraint/RemainCityCapacity.php +++ b/hwe/sammo/Constraint/RemainCityCapacity.php @@ -11,7 +11,7 @@ class RemainCityCapacity extends Constraint{ protected $maxKey; protected $keyNick; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/RemainCityTrust.php b/hwe/sammo/Constraint/RemainCityTrust.php index 774b60ef..4d6658ff 100644 --- a/hwe/sammo/Constraint/RemainCityTrust.php +++ b/hwe/sammo/Constraint/RemainCityTrust.php @@ -11,7 +11,7 @@ class RemainCityTrust extends Constraint{ protected $maxKey; protected $keyNick; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqCityCapacity.php b/hwe/sammo/Constraint/ReqCityCapacity.php index cc5f287c..b3281173 100644 --- a/hwe/sammo/Constraint/ReqCityCapacity.php +++ b/hwe/sammo/Constraint/ReqCityCapacity.php @@ -13,7 +13,7 @@ class ReqCityCapacity extends Constraint{ protected $keyNick; protected $reqVal; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqCityTrader.php b/hwe/sammo/Constraint/ReqCityTrader.php index 2e6cd162..74b033c2 100644 --- a/hwe/sammo/Constraint/ReqCityTrader.php +++ b/hwe/sammo/Constraint/ReqCityTrader.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqCityTrader extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqCityTrust.php b/hwe/sammo/Constraint/ReqCityTrust.php index 7688e15c..a719d0dd 100644 --- a/hwe/sammo/Constraint/ReqCityTrust.php +++ b/hwe/sammo/Constraint/ReqCityTrust.php @@ -11,7 +11,7 @@ class RemainCityTrust extends Constraint{ protected $maxKey; protected $keyNick; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqEnvValue.php b/hwe/sammo/Constraint/ReqEnvValue.php index 4df65e36..e655daa1 100644 --- a/hwe/sammo/Constraint/ReqEnvValue.php +++ b/hwe/sammo/Constraint/ReqEnvValue.php @@ -17,7 +17,7 @@ class ReqEnvValue extends Constraint{ protected $comp; protected $msg; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php b/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php index b331c943..3e698469 100644 --- a/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php +++ b/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php @@ -6,7 +6,7 @@ use sammo\GameConst; class ReqGeneralAtmosMargin extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralCrew.php b/hwe/sammo/Constraint/ReqGeneralCrew.php index 132a04a8..83d1b44e 100644 --- a/hwe/sammo/Constraint/ReqGeneralCrew.php +++ b/hwe/sammo/Constraint/ReqGeneralCrew.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqGeneralCrew extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralCrewMargin.php b/hwe/sammo/Constraint/ReqGeneralCrewMargin.php index 4c5db62c..bae4cc74 100644 --- a/hwe/sammo/Constraint/ReqGeneralCrewMargin.php +++ b/hwe/sammo/Constraint/ReqGeneralCrewMargin.php @@ -10,7 +10,7 @@ class ReqGeneralCrewMargin extends Constraint{ protected $crewType; 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralGold.php b/hwe/sammo/Constraint/ReqGeneralGold.php index f54f7ef7..aa6fdff0 100644 --- a/hwe/sammo/Constraint/ReqGeneralGold.php +++ b/hwe/sammo/Constraint/ReqGeneralGold.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqGeneralGold extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralRice.php b/hwe/sammo/Constraint/ReqGeneralRice.php index 6e1e3d67..9308cdb4 100644 --- a/hwe/sammo/Constraint/ReqGeneralRice.php +++ b/hwe/sammo/Constraint/ReqGeneralRice.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqGeneralRice extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralTrainMargin.php b/hwe/sammo/Constraint/ReqGeneralTrainMargin.php index f14af95c..98343aa5 100644 --- a/hwe/sammo/Constraint/ReqGeneralTrainMargin.php +++ b/hwe/sammo/Constraint/ReqGeneralTrainMargin.php @@ -6,7 +6,7 @@ use sammo\GameConst; class ReqGeneralTrainMargin extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralValue.php b/hwe/sammo/Constraint/ReqGeneralValue.php index 8a165076..489d25e3 100644 --- a/hwe/sammo/Constraint/ReqGeneralValue.php +++ b/hwe/sammo/Constraint/ReqGeneralValue.php @@ -17,7 +17,7 @@ class ReqGeneralValue extends Constraint{ protected $reqVal; protected $comp; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqNationValue.php b/hwe/sammo/Constraint/ReqNationValue.php index 16364334..560bc093 100644 --- a/hwe/sammo/Constraint/ReqNationValue.php +++ b/hwe/sammo/Constraint/ReqNationValue.php @@ -17,7 +17,7 @@ class ReqNationValue extends Constraint{ protected $reqVal; protected $comp; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/ReqNationalGold.php b/hwe/sammo/Constraint/ReqNationalGold.php index 6183305b..ed01d856 100644 --- a/hwe/sammo/Constraint/ReqNationalGold.php +++ b/hwe/sammo/Constraint/ReqNationalGold.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqNationGold extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqNationalRice.php b/hwe/sammo/Constraint/ReqNationalRice.php index 1b7d4a90..449529f3 100644 --- a/hwe/sammo/Constraint/ReqNationalRice.php +++ b/hwe/sammo/Constraint/ReqNationalRice.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class ReqNationRice extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/ReqTroopMembers.php b/hwe/sammo/Constraint/ReqTroopMembers.php index 78de204f..64319ac6 100644 --- a/hwe/sammo/Constraint/ReqTroopMembers.php +++ b/hwe/sammo/Constraint/ReqTroopMembers.php @@ -6,7 +6,7 @@ use sammo\DB; class ReqTroopMembers extends Constraint{ const REQ_VALUES = Constraint::REQ_GENERAL; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/SuppliedCity.php b/hwe/sammo/Constraint/SuppliedCity.php index 625ef0a4..0b6c26bc 100644 --- a/hwe/sammo/Constraint/SuppliedCity.php +++ b/hwe/sammo/Constraint/SuppliedCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class SuppliedCity extends Constraint{ const REQ_VALUES = Constraint::REQ_CITY; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/Constraint/SuppliedDestCity.php b/hwe/sammo/Constraint/SuppliedDestCity.php index f1b7bb6f..1f3645d9 100644 --- a/hwe/sammo/Constraint/SuppliedDestCity.php +++ b/hwe/sammo/Constraint/SuppliedDestCity.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class SuppliedDestCity extends Constraint{ 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){ return false; } diff --git a/hwe/sammo/Constraint/WanderingNation.php b/hwe/sammo/Constraint/WanderingNation.php index 0494783b..ac9e8a09 100644 --- a/hwe/sammo/Constraint/WanderingNation.php +++ b/hwe/sammo/Constraint/WanderingNation.php @@ -5,7 +5,7 @@ namespace sammo\Constraint; class WanderingNation extends Constraint{ const REQ_VALUES = Constraint::REQ_NATION; - public function checkInputValues(bool $throwExeception=true){ + public function checkInputValues(bool $throwExeception=true):bool{ if(!parent::checkInputValues($throwExeception) && !$throwExeception){ return false; } diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 2a948180..f3a25f4b 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -989,6 +989,7 @@ class GeneralAI{ $db = DB::db(); + $arg = null; // 오랑캐는 바로 임관 if($general->getVar('npc') == 9) { diff --git a/hwe/sammo/TextDecoration/SightseeingMessage.php b/hwe/sammo/TextDecoration/SightseeingMessage.php index a9458e16..4f3599a4 100644 --- a/hwe/sammo/TextDecoration/SightseeingMessage.php +++ b/hwe/sammo/TextDecoration/SightseeingMessage.php @@ -1,5 +1,6 @@