name of current gamestate

Game development with Board Game Arena Studio
Post Reply
User avatar
Denis
Posts: 12
Joined: 28 February 2012, 06:31

name of current gamestate

Post 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.
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: name of current gamestate

Post 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
Post Reply

Return to “Developers”