Page 1 of 1

Move number

Posted: 21 November 2016, 02:16
by Victoria_La
When game goes to archive you can replay it and it shows Move # in top left corner. Is this available some-how in the database during the game?
I want to annotation my log message with move # but I am afraid if I calculate it myself it will be out of sync with that replay number...

Re: Move number

Posted: 30 November 2016, 00:39
by Victoria_La
Replying to my own post since I figured it out. Its a global variable number 6.
So in Php constructor
self::initGameStateLabels(array (
'move_nbr' => 6,
...
));

Where you need it:

$move = $this->getGameStateValue('move_nbr');
$this->trace("move number $move");

Re: Move number

Posted: 15 September 2021, 23:19
by Victoria_La
That was very wrong btw, the move number is actually global id 3, not 6. And you can just get it directly without label initializarion because
it is initialized by framework, i.e.

Code: Select all

$this->getGameStateValue('next_move_id'); // this is move number - global 3

$this->getGameStateValue('playerturn_nbr'); // this player turn number - global 6