From 6ef9667f72b67efc7ae804348b97644b2a3478fa Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 16 Nov 2018 23:35:43 +0900 Subject: [PATCH] =?UTF-8?q?Constraint=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Constraint/ContraintHelper.php | 32 ++++++++++++++++++------ hwe/sammo/Constraint/ReqNationValue.php | 2 +- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/hwe/sammo/Constraint/ContraintHelper.php b/hwe/sammo/Constraint/ContraintHelper.php index 3386168a..26a22d3c 100644 --- a/hwe/sammo/Constraint/ContraintHelper.php +++ b/hwe/sammo/Constraint/ContraintHelper.php @@ -4,6 +4,10 @@ namespace sammo\Constraint; class ConstraintHelper{ + static function AdhocCallback(callable $callback):array{ + return [__FUNCTION__, $callback]; + } + static function AllowJoinAction():array{ return [__FUNCTION__]; } @@ -80,10 +84,6 @@ class ConstraintHelper{ return [__FUNCTION__]; } - static function NearCity(int $distance):array{ - return [__FUNCTION__, $distance]; - } - static function MustBeNPC():array{ return [__FUNCTION__]; } @@ -91,6 +91,10 @@ class ConstraintHelper{ static function MustBeTroopLeader():array{ return [__FUNCTION__]; } + + static function NearCity(int $distance):array{ + return [__FUNCTION__, $distance]; + } static function NotBeNeutral():array{ return [__FUNCTION__]; @@ -100,6 +104,14 @@ class ConstraintHelper{ return [__FUNCTION__, $ignoreOfficer]; } + static function NotChief():array{ + return [__FUNCTION__]; + } + + static function NotLord():array{ + return [__FUNCTION__]; + } + static function NotOccupiedCity():array{ return [__FUNCTION__]; } @@ -112,10 +124,6 @@ class ConstraintHelper{ return [__FUNCTION__]; } - static function NotLord():array{ - return [__FUNCTION__]; - } - static function NotWanderingNation():array{ return [__FUNCTION__]; } @@ -128,6 +136,10 @@ class ConstraintHelper{ return [__FUNCTION__, $key, $actionName]; } + static function RemainCityTrust(string $actionName):array{ + return [__FUNCTION__, $actionName]; + } + static function ReqCityCapacity($key, string $keyNick, $reqVal):array{ return [__FUNCTION__, $key, $keyNick, $reqVal]; } @@ -172,6 +184,10 @@ class ConstraintHelper{ return [__FUNCTION__, $key, $keyNick, $comp, $reqVal]; } + static function ReqNationValue($key, string $keyNick, string $comp, $reqVal):array{ + return [__FUNCTION__, $key, $keyNick, $comp, $reqVal]; + } + static function ReqTroopMembers():array{ return [__FUNCTION__]; } diff --git a/hwe/sammo/Constraint/ReqNationValue.php b/hwe/sammo/Constraint/ReqNationValue.php index a35892de..128cfba0 100644 --- a/hwe/sammo/Constraint/ReqNationValue.php +++ b/hwe/sammo/Constraint/ReqNationValue.php @@ -23,7 +23,7 @@ class ReqNationValue extends Constraint{ } if(count($this->arg) == 4){ - [$this->key, $this->keyNick, $this->reqVal, $comp] = $this->arg; + [$this->key, $this->keyNick, $comp, $this->reqVal] = $this->arg; if(!in_array($comp, ['>', '>=', '==', '<=', '<', '!=', '===', '!=='])){ if(!$throwExeception){return false; }