GameManager/games/Example.php

43 lines
968 B
PHP
Raw Normal View History

2016-07-31 10:25:30 +00:00
<?php
use Ad5001\GameManager\Game;
use pocketmine\Player;
class Example extends Game {
public function onGameStart() {
2016-07-31 19:46:09 +00:00
$this->getLogger()->info("Game started");
}
public function onGameStop() {
$this->getLogger()->info("Game stoped");
}
2016-08-02 07:25:31 +00:00
public function onJoin(Player $player) {
parent::onJoin($player);
$this->getPlugin()->getLogger()->info($player->getName() . " joined the game " . $this->getName() . " in world " . $this->getLevel()->getName());
}
public function onQuit(Player $player) {
parent::onJoin($player);
$this->getPlugin()->getLogger()->info($player->getName() . " left the game " . $this->getName() . " in world " . $this->getLevel()->getName());
}
2016-08-01 10:29:14 +00:00
2016-07-31 19:46:09 +00:00
public function getName() : string {
return "Example";
}
public function getMinPlayers() : int {
return 1;
}
public function getMaxPlayers() : int {
return 5;
2016-07-31 10:25:30 +00:00
}
}