feat: StaticEventHandler 처리기 추가
- 커맨드 종료 시점에 호출 - pre, post 각각이 필요한지는 논의 필요 - 일단 용도에 따라 pre, post 둘중에 하나만 처리 - eventType으로는 full qualified class name 사용 - 꼭 그럴필요는 없지만, 커맨드에 한해서는 이렇게
This commit is contained in:
@@ -20,6 +20,7 @@ use function \sammo\getNationStaticInfo;
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_급습 extends Command\NationCommand
|
||||
{
|
||||
@@ -191,6 +192,7 @@ class che_급습 extends Command\NationCommand
|
||||
$db->update('diplomacy', [
|
||||
'term' => $db->sqleval('`term` - %i', 3),
|
||||
], '(me = %i AND you = %i) OR (you = %i AND me = %i)', $nationID, $destNationID, $nationID, $destNationID);
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user