PHP Class Slackwolf\Game\GameManager

Show file Open project: chrisgillis/slackwolf Class Usage Examples

Public Properties

Property Type Description
$optionsManager OptionsManager

Public Methods

Method Description
__construct ( RealTimeClient $client, array $commandBindings ) Defines the GameManager constructor.
changeGameState ( $gameId, $newGameState )
endGame ( $id, null $enderUserId = null )
getGame ( $id ) : Game | boolean
hasGame ( $id ) : boolean
input ( Message $message ) : boolean
newGame ( $id, array $users, $roleStrategy )
sendMessageToChannel ( Game $game, $msg ) Sends a message to a game.
startGame ( $id )
vote ( Game $game, $voterId, $voteForId )

Private Methods

Method Description
addGame ( Game $game )
onDay ( Game $game )
onFirstNight ( Game $game )
onGameOver ( Game $game )
onNight ( Game $game )
onNightEnd ( Game $game )

Method Details

__construct() public method

Defines the GameManager constructor.
public __construct ( RealTimeClient $client, array $commandBindings )
$client Slack\RealTimeClient
$commandBindings array

changeGameState() public method

public changeGameState ( $gameId, $newGameState )
$gameId
$newGameState

endGame() public method

public endGame ( $id, null $enderUserId = null )
$id
$enderUserId null

getGame() public method

public getGame ( $id ) : Game | boolean
$id
return Game | boolean

hasGame() public method

public hasGame ( $id ) : boolean
$id
return boolean

input() public method

public input ( Message $message ) : boolean
$message Slackwolf\Message\Message
return boolean

newGame() public method

public newGame ( $id, array $users, $roleStrategy )
$id
$users array
$roleStrategy

sendMessageToChannel() public method

Sends a message to a game.
public sendMessageToChannel ( Game $game, $msg )
$game Game The game to send the message.
$msg The message.

startGame() public method

public startGame ( $id )
$id

vote() public method

public vote ( Game $game, $voterId, $voteForId )
$game Game
$voterId
$voteForId

Property Details

$optionsManager public property

public OptionsManager,Slackwolf\Game $optionsManager
return OptionsManager