Move this.turn to PetraBot

The `BaseAI` shouldn't make assumptions whether the AI runs every turn.
This commit is contained in:
phosit 2025-09-07 15:04:40 +02:00
parent babe9e5c18
commit a4b580991b
No known key found for this signature in database
GPG key ID: C9430B600671C268
2 changed files with 2 additions and 3 deletions

View file

@ -6,9 +6,6 @@ export function BaseAI(settings)
return;
this.player = settings.player;
// played turn, in case you don't want the AI to play every turn.
this.turn = 0;
}
/** Return a simple object (using no classes etc) that will be serialized into saved games */

View file

@ -9,6 +9,8 @@ export function PetraBot(settings)
{
BaseAI.call(this, settings);
// played turn, because Petra doesn't play every turn.
this.turn = 0;
this.playedTurn = 0;
this.elapsedTime = 0;