초기 constraint 지정

This commit is contained in:
2018-09-02 13:17:26 +09:00
parent 16831880dd
commit df6b2bd0e8
6 changed files with 302 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace sammo\Constraint;
class NoOpeningPart extends Constraint{
const REQ_VALUES = Constraint::REQ_INT_ARG;
protected $relYear;
public function checkInputValues(bool $throwExeception=true){
if(!parent::checkInputValues($throwExeception) && !$throwException){
return false;
}
$this->relYear = $this->arg;
return true;
}
public function test():bool{
$this->checkInputValues();
$this->tested = true;
if($relYear >= GameConst::$openingPartYear){
return true;
}
$this->reason = "초반 제한 중에는 불가능합니다.";
return false;
}
}