Skip to content

Commit

Permalink
improve error message, initialize scoring tiles by default
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Oct 19, 2024
1 parent 964d6b5 commit 1c3178f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/BotActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function getScoringActions(scoringAction: ScoringAction, round: number,
function getEraScoringCategory(eraScoringTiles: ScoringCategory[], round:number) : ScoringCategory {
const scoringCategory = eraScoringTiles[round-1]
if (!scoringCategory) {
throw new Error(`Invalid era scoring category: ${round}`)
throw new Error(`No era scoring category for round ${round}: ${eraScoringTiles}`)
}
return scoringCategory
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/helper/mockState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function (params?: MockStateParams) : State {
baseFontSize: 1,
setup: {
difficultyLevel: params?.difficultyLevel ?? DifficultyLevel.BEGINNER,
eraScoringTiles: params?.eraScoringTiles ?? [],
finalScoringTiles: params?.finalScoringTiles ?? [],
eraScoringTiles: params?.eraScoringTiles ?? [ScoringCategory.CONSTRUCTION,ScoringCategory.CULTURE,ScoringCategory.EVOLUTION,ScoringCategory.EXPANSION],
finalScoringTiles: params?.finalScoringTiles ?? [ScoringCategory.KNOWLEDGE,ScoringCategory.POPULATION,ScoringCategory.PRESTIGE],
initialCardDeck: params?.initialCardDeck
},
rounds: params?.rounds ?? []
Expand Down

0 comments on commit 1c3178f

Please sign in to comment.