- 커맨드 종료 시점에 호출 - pre, post 각각이 필요한지는 논의 필요 - 일단 용도에 따라 pre, post 둘중에 하나만 처리 - eventType으로는 full qualified class name 사용 - 꼭 그럴필요는 없지만, 커맨드에 한해서는 이렇게
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
namespace sammo\Command\General;
|
|
|
|
use \sammo\Command;
|
|
use \sammo\Util;
|
|
use \sammo\JosaUtil;
|
|
use \sammo\LastTurn;
|
|
use \sammo\DB;
|
|
use sammo\StaticEventHandler;
|
|
|
|
class 휴식 extends Command\GeneralCommand{
|
|
static protected $actionName = '휴식';
|
|
|
|
protected function argTest():bool{
|
|
return true;
|
|
}
|
|
|
|
protected function init()
|
|
{
|
|
$this->minConditionConstraints=[];
|
|
$this->fullConditionConstraints=[];
|
|
}
|
|
|
|
public function getCost():array{
|
|
return [0, 0];
|
|
}
|
|
|
|
public function getPreReqTurn():int{
|
|
return 0;
|
|
}
|
|
|
|
public function getPostReqTurn():int{
|
|
return 0;
|
|
}
|
|
|
|
public function run(\Sammo\RandUtil $rng):bool{
|
|
$general = $this->generalObj;
|
|
$logger = $general->getLogger();
|
|
$date = $general->getTurnTime($general::TURNTIME_HM);
|
|
$logger->pushGeneralActionLog("아무것도 실행하지 않았습니다. <1>$date</>");
|
|
|
|
$this->setResultTurn(new LastTurn());
|
|
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
|
$general->applyDB(DB::db());
|
|
return true;
|
|
}
|
|
} |