diff --git a/hwe/sammo/LastTurn.php b/hwe/sammo/LastTurn.php new file mode 100644 index 00000000..5db76647 --- /dev/null +++ b/hwe/sammo/LastTurn.php @@ -0,0 +1,53 @@ +command = $command; + } + + function getCommand():string{ + return $this->command; + } + + function setArg(?array $arg){ + $this->arg = $arg; + } + + function getArg():?array{ + return $this->arg; + } + + function setTerm(?int $term){ + $this->term = $term; + } + + function getTerm():?int{ + return $this->term; + } + + function toJson():string{ + $result = [ + 'command'=>$this->command + ]; + if($this->arg !== null){ + $result['arg'] = $this->arg; + } + if($this->term !== null){ + $result['term'] = $this->term; + } + return Json::encode($result); + } +} \ No newline at end of file