Agents¶
- class pyscoundrel.agents.base.Agent[source]¶
Bases:
ABCAbstract base class for PyScoundrel agents.
Custom agents should inherit from this class and implement the decision-making methods.
- abstractmethod decide_avoid_room(state: GameState) bool[source]¶
Decide whether to avoid the current room.
- Parameters:
state – Current game state
- Returns:
True to avoid the room, False to face it
- abstractmethod choose_card(state: GameState, available_cards: list[Card]) Tuple[int, str][source]¶
Choose which card to face and how to handle it.
- Parameters:
state – Current game state
available_cards – List of cards not yet faced in current room
- Returns:
card_index: Index in available_cards list (0-based)
method: One of “barehanded”, “weapon”, or “auto” for non-monsters
- Return type:
Tuple of (card_index, method) where