Page 1 of 1

name of current gamestate

Posted: 21 November 2014, 02:36
by Denis
How do you get the "name" of the current state?

I'm not sure what the source for the "$this->gamestate" class looks like, so am only aware of methods advertised on the wiki. I tried var_dump() but it was very noisy. I did find a property called "current_state" but it is private.

Re: name of current gamestate

Posted: 22 November 2014, 06:52
by pikiou
Here it is:

Code: Select all

// Get current game state
$state = $this->gamestate->state();
if( $state['name'] == 'myGameState' )
{
...
}
From http://en.doc.boardgamearena.com/Your_g ... c.php#name