33from .play_on_decision_maker import PlayOnDecisionMaker
44from .set_play_decision_maker import SetPlayDecisionMaker
55from .penalty_decision_maker import PenaltyDecisionMaker
6+ from .goalie_decision_maker import GoalieDecisionMaker
67from service_pb2 import *
78
89if TYPE_CHECKING :
@@ -14,12 +15,14 @@ class DecisionMaker(IDecisionMaker):
1415 Attributes:
1516 play_on_decision_maker (PlayOnDecisionMaker): Handles decisions during the 'PlayOn' game mode.
1617 set_play_decision_maker (SetPlayDecisionMaker): Handles decisions during set plays.
18+ penalty_decision_maker (PenaltyDecisionMaker): Handles decisions during penalty kicks.
19+ goalie_decision_maker (GoalieDecisionMaker): Handles decisions for goalies.
1720 Methods:
1821 __init__():
1922 Initializes the DecisionMaker with specific decision makers for different game modes.
2023 make_decision(agent: IAgent):
2124 Makes a decision for the given agent based on its role and the current game mode.
22- If the agent is a goalie, it adds a goalie action.
25+ If the agent is a goalie, it adds a goalie action using goalie_decision_maker .
2326 If the game mode is 'PlayOn', it delegates the decision to play_on_decision_maker.
2427 If the game mode is a penalty kick, it adds a penalty action using penalty_decision_maker.
2528 Otherwise, it adds a set play action using set_play_decision_maker.
@@ -28,10 +31,11 @@ def __init__(self, agent: "SamplePlayerAgent"):
2831 self .play_on_decision_maker = PlayOnDecisionMaker (agent )
2932 self .set_play_decision_maker = SetPlayDecisionMaker (agent )
3033 self .penalty_decision_maker = PenaltyDecisionMaker (agent )
34+ self .goalie_decision_maker = GoalieDecisionMaker (agent )
3135
3236 def make_decision (self , agent : "SamplePlayerAgent" ):
3337 if agent .wm .self .is_goalie :
34- agent . add_action ( PlayerAction ( helios_goalie = HeliosGoalie ()) )
38+ self . goalie_decision_maker . make_decision ( agent )
3539 elif agent .wm .game_mode_type == GameModeType .PlayOn :
3640 self .play_on_decision_maker .make_decision (agent )
3741 elif agent .wm .is_penalty_kick_mode :
0 commit comments