games.monopoly.game_agent¶
Fixed Monopoly game agent implementation.
This module provides the corrected main game agent for orchestrating a Monopoly game, with proper handling of BaseModel objects from LangGraph instead of dictionaries.
Classes¶
Main game agent for orchestrating Monopoly. |
|
Configuration for monopoly game agent. |
Module Contents¶
- class games.monopoly.game_agent.MonopolyGameAgent(config)¶
Bases:
haive.core.engine.agent.agent.Agent
[MonopolyGameAgentConfig
]Main game agent for orchestrating Monopoly.
Initialize the game agent.
- Parameters:
config (MonopolyGameAgentConfig)
- check_doubles(state)¶
Check if doubles were rolled and handle accordingly.
- check_game_end_node(state)¶
Check if the game should end.
- end_turn(state)¶
End the current player’s turn.
- handle_jail_turn(state)¶
Handle a turn when player is in jail.
- Parameters:
state (haive.games.monopoly.state.MonopolyState)
- Return type:
langgraph.types.Command
- handle_landing(state)¶
Handle the player landing on a space.
- handle_property_space(state, property_name)¶
Handle landing on a property space.
- Parameters:
state (haive.games.monopoly.state.MonopolyState)
property_name (str)
- Return type:
langgraph.types.Command
- handle_special_space(state, space_name)¶
Handle landing on special spaces like GO, Jail, etc.
- Parameters:
state (haive.games.monopoly.state.MonopolyState)
space_name (str)
- Return type:
langgraph.types.Command
- move_player_node(state)¶
Move the current player based on dice roll.
- offer_property_purchase(state, property_obj)¶
Offer property purchase to current player.
- Parameters:
state (haive.games.monopoly.state.MonopolyState)
- Return type:
langgraph.types.Command
- pay_rent(state, property_obj)¶
Handle rent payment.
- Parameters:
state (haive.games.monopoly.state.MonopolyState)
- Return type:
langgraph.types.Command
- roll_dice_node(state)¶
Roll dice for the current player.
- route_after_doubles(state)¶
Route based on doubles status.
- route_game_end(state)¶
Route based on game end status.
- setup_workflow()¶
Set up the main game workflow.
- Return type:
None
- class games.monopoly.game_agent.MonopolyGameAgentConfig¶
Bases:
haive.core.engine.agent.config.AgentConfig
Configuration for monopoly game agent.