feat: 턴 선택기를 vue 기반으로 변경

This commit is contained in:
2021-11-28 01:57:46 +09:00
parent 9adcbecce4
commit 0aaadf9536
12 changed files with 548 additions and 342 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace sammo\API\Command;
use sammo\Session;
use DateTimeInterface;
use sammo\Validator;
use function sammo\cutTurn;
use function sammo\repeatGeneralCommand;
class RepeatCommand extends \sammo\BaseAPI
{
public function validateArgs(): ?string
{
$v = new Validator($this->args);
$v->rule('required', [
'amount',
])
->rule('integer', 'amount')
->rule('min', 'amount', 1)
->rule('max', 'amount', 12);
if (!$v->validate()) {
return $v->errorStr();
}
return null;
}
public function getRequiredSessionMode(): int
{
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
}
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
{
$amount = $this->args['amount'];
repeatGeneralCommand($session->generalID, $amount);
return [
'result'=>true
];
}
}