Hey there,
do the following:
Go to POGameHandler.cs in AI=>SabberStoneCoreAi=>Src=>POGame=>POGameHandler.cs
At the end of the "public bool PlayGame(bool addToGameStats=true)" function at lines 95 & 96 it calls the FinalizeGames() of the two players.
Replace the two calls with
player1.FinalizeGame(game.CurrentPlayer == game.Player1 ? game.CurrentPlayer.PlayState : game.CurrentOpponent.PlayState);
player2.FinalizeGame(!(game.CurrentPlayer == game.Player1) ? game.CurrentPlayer.PlayState : game.CurrentOpponent.PlayState);
Now go to the AbstractAgent.cs and define this function:
public abstract void FinalizeGame(PlayState playState);
and define a using at the beginning of the file:
using SabberStoneCore.Enums;
Now browse to
ALL the different agents and define the
public override void FinalizeGame(PlayState playState)
{
}
function and the using statement in these (as you did in the AbstractAgent).
You have to define it in all agents or else it will throw errors.
The playState contains the information you asked for.
Before submitting your agent make sure it is runnable on a "vanilla" version of SabberStone ie. remove the "override" in the FinalizeGame(PlayState playState)
so it will not try to override a nonexistent abstract function in AbstractAgent.cs and throw an error/exception.
Best regards
Hans-Martin