From b7dbbf6fd7c8c2ff70b649505f24fd5ab805b4ae Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 4 Jan 2025 09:34:42 +0000 Subject: [PATCH 1/2] set next version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d526292..2a3cfc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brdgm/civolution-solo-helper", - "version": "1.1.5", + "version": "1.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@brdgm/civolution-solo-helper", - "version": "1.1.5", + "version": "1.1.6", "dependencies": { "@brdgm/brdgm-commons": "^1.6.9", "@popperjs/core": "^2.11.8", diff --git a/package.json b/package.json index 0ca7e1d..0c7f430 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brdgm/civolution-solo-helper", - "version": "1.1.5", + "version": "1.1.6", "private": true, "description": "Civolution Solo Helper", "appDeployName": "civolution", From 32f64058cc9654e35636768d0592c0d6c3303038 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Wed, 8 Jan 2025 22:20:17 +0100 Subject: [PATCH 2/2] Do not reset count of red/blue dots at end of the round (#11) and don't draw a new card already in the round start view --- src/util/NavigationState.ts | 5 +---- tests/unit/services/BotActions.spec.ts | 5 +---- tests/unit/util/NavigationState.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/util/NavigationState.ts b/src/util/NavigationState.ts index d61b489..589a1d9 100644 --- a/src/util/NavigationState.ts +++ b/src/util/NavigationState.ts @@ -73,7 +73,7 @@ export default class NavigationState { redDotCount = 0 } // draw next card, count dots - if (this.player == Player.BOT) { + if (this.player == Player.BOT && route.name == 'TurnBot') { const nextCard = this.cardDeck.draw() this.blueDotCount = blueDotCount + nextCard.blueDotCount this.redDotCount = redDotCount + nextCard.redDotCount @@ -147,9 +147,6 @@ function getPreviousBotPersistence(state: State, round: number, turn: number) : if (round > 1) { const lastRoundBotPersistence = getPreviousBotPersistence(state, round - 1, MAX_TURN) if (lastRoundBotPersistence) { - // reset dot counters for new round - lastRoundBotPersistence.blueDotCount = 0 - lastRoundBotPersistence.redDotCount = 0 return lastRoundBotPersistence } } diff --git a/tests/unit/services/BotActions.spec.ts b/tests/unit/services/BotActions.spec.ts index c38fab3..635d01f 100644 --- a/tests/unit/services/BotActions.spec.ts +++ b/tests/unit/services/BotActions.spec.ts @@ -99,10 +99,7 @@ describe('services/BotActions', () => { const navigationState = new NavigationState(route, getState(DifficultyLevel.BEGINNER)) const botActions = new BotActions(Cards.get(13), navigationState) - expect(botActions.isReset).to.eq(false) - expect(botActions.items).to.eql([ - { action: Action.GAIN_VP, count: 4 } - ]) + expect(botActions.isReset).to.eq(true) }) it('scoringActions-last-era-scoring-category', () => { diff --git a/tests/unit/util/NavigationState.spec.ts b/tests/unit/util/NavigationState.spec.ts index fa8884d..1621460 100644 --- a/tests/unit/util/NavigationState.spec.ts +++ b/tests/unit/util/NavigationState.spec.ts @@ -103,8 +103,8 @@ describe('util/NavigationState', () => { expect(navigationState.cardDeck.toPersistence()).to.eql({pile:[4],discard:[3,2,1]}) expect(navigationState.evolutionCount).to.eq(2) expect(navigationState.prosperityCount).to.eq(1) - expect(navigationState.blueDotCount).to.eq(2) // card3.blueDotCount = 2 - expect(navigationState.redDotCount).to.eq(1) // card3.redDotCount = 1 + expect(navigationState.blueDotCount).to.eq(5) // taken over from last round + expect(navigationState.redDotCount).to.eq(2) // taken over from last round expect(navigationState.actionRoll).to.greaterThanOrEqual(1) })