전략별 쿨타임 적용

This commit is contained in:
2020-07-13 23:21:21 +09:00
parent 6306dae92d
commit 27e5d73da1
16 changed files with 2229 additions and 2157 deletions
+4 -3
View File
@@ -4,14 +4,14 @@ use \sammo\Util;
abstract class GeneralCommand extends BaseCommand{
protected function getNextExecuteKey():string{
public function getNextExecuteKey():string{
$turnKey = static::$actionName;
$generalID = $this->getGeneral()->getID();
$executeKey = "next_execute_{$generalID}_{$turnKey}";
return $executeKey;
}
public function getNextAvailable():?int{
public function getNextAvailableTurn():?int{
if($this->isArgValid && !$this->getPostReqTurn()){
return null;
}
@@ -25,7 +25,8 @@ abstract class GeneralCommand extends BaseCommand{
return;
}
if($yearMonth === null){
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']) + $this->getPostReqTurn();
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month'])
+ $this->getPostReqTurn() - $this->getPreReqTurn();
}
$db = \sammo\DB::db();