'지난 턴'을 관리하는 기능 추가

This commit is contained in:
2018-10-03 22:38:05 +09:00
parent a33a7317cc
commit e1a266e5d8
11 changed files with 114 additions and 45 deletions
+13 -1
View File
@@ -6,9 +6,21 @@ class LastTurn{
protected $arg = null;
protected $term = null;
function __construct(string $json)
function __construct(?string $command=null, ?array $arg=null, ?int $term=null)
{
$this->setCommand($command);
$this->setArg($arg);
$this->setTerm($term);
}
static function fromJson(string $json):self{
$values = Json::decode($json);
$obj = new static(
$values['command']??null,
$values['arg']??null,
$values['term']??null
);
return $obj;
}
function setCommand(?string $command){