Constraint 수정
This commit is contained in:
@@ -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__];
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user