Coverage for src / beaverbunch / core / game_settings.py: 100.0%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-05 20:45 +0000

1from dataclasses import dataclass, field 

2from typing import Callable 

3 

4from beaverbunch.core.card import Card 

5from beaverbunch.core.deck import Deck 

6 

7 

8@dataclass 

9class GameSettings: 

10 """Configuration settings for a game of BeaverBunch, including hand size, number of known cards, player limits, and deck factory. 

11 

12 Attributes: 

13 initial_hand_size: The number of cards each player starts with in their hand. 

14 initial_cards_known: The number of cards in each player's hand that are initially known to the player. 

15 min_players: The minimum number of players required to start the game. 

16 max_players: The maximum number of players allowed in the game. 

17 deck_factory: A callable that returns a list of Card objects to be used as the deck for the game. By default, it creates a standard 52+2 deck of cards. 

18 """ 

19 initial_hand_size: int = 4 

20 initial_cards_known: int = 2 

21 min_players: int = 2 

22 max_players: int = 6 

23 deck_factory: Callable[[], list[Card]] = field(default=Deck.create_new)