# Path: oscar/agent/custom_agent.py
# class CustomAgent(BaseAgent):
#     """A base agent to write custom scripted agents."""
# 
#     def __init__(self):
#         super().__init__()
#         self._shared = {}
# 
#     def add_shared(self, name, shared):
#         self._shared[name] = shared


from pysc2.lib import actions
from oscar.agent.custom_agent import CustomAgent
import random



# TODO: As RandomAgent is no more callable directly by pysc2, action_spec is undefined.
class RandomAgent(CustomAgent):
    def __init__(self):
        super().__init__()

    def step(self, obs, locked_choice=None):
        output = []
        selected_action_id = random.choice(obs.observation["available_actions"])

# Path: oscar/agent/custom_agent.py
# class CustomAgent(BaseAgent):
#     """A base agent to write custom scripted agents."""
# 
#     def __init__(self):
#         super().__init__()
#         self._shared = {}
# 
#     def add_shared(self, name, shared):
#         self._shared[name] = shared


# Path: oscar/agent/scripted/random.py
from pysc2.lib import actions
from oscar.agent.custom_agent import CustomAgent
import random




# TODO: As RandomAgent is no more callable directly by pysc2, action_spec is undefined.
class RandomAgent(CustomAgent):
    def __init__(self):
        super().__init__()

    def step(self, obs, locked_choice=None):
        output = []
        selected_action_id = random.choice(obs.observation["available_actions"])

        args = self.action_spec.functions[selected_action_id].args