More n00b questions:
A notify method I registered does not seem to ever get invoked.
In my game.php file:
In my .js file:
and
The stAssignRoles() method does execute, but I never see the notification get triggered.
A notify method I registered does not seem to ever get invoked.
In my game.php file:
Code: Select all
function stAssignRoles() {
$this->cards->moveAllCardsInLocation(null, 'deck');
$this->cards->moveAllCardsInLocation(null, 'doordeck');
$this->cards->shuffle('deck');
$this->cards->shuffle('doordeck');
$players = self::loadPlayersBasicInfos();
foreach( $players as $player_id => $player ) {
$door = $this->cards->pickCard( 'doordeck', $player_id );
//Notify player of his Role
self::notifyPlayer( $player_id, 'newRole', '', array(
'hand' => $door
) );
}
$cards = $this->cards->pickCardsForLocation(4, 'deck', 'cluecarddisplay');
$this->gamestate->nextState( "" );
}
Code: Select all
setupNotifications: function()
{
console.log( 'notifications subscriptions setup' );
// here, associate your game notifications with local methods
dojo.subscribe( 'newRole', this, 'notif_newRole' );
},
Code: Select all
/**
* Called when a player is a given a new Door (role) card
*/
notif_newRole: function( notif ) {
console.log("notifying of new role");
throw new BgaVisibleSystemException ( "This never happens, but it should!");
},
The stAssignRoles() method does execute, but I never see the notification get triggered.