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; }