# Path: pysc2/env/mock_sc2_env.py
# DUMMY_MAP_SIZE = point.Point(256, 256)
# class _TestEnvironment(environment.Base):
# class SC2TestEnv(_TestEnvironment):
#   def __init__(self, num_agents, observation_spec, action_spec):
#   def reset(self):
#   def step(self, actions, step_mul=None):
#   def action_spec(self):
#   def observation_spec(self):
#   def _default_observation(self, obs_spec, agent_index):
#   def __init__(self,
#                _only_use_kwargs=None,
#                map_name=None,
#                players=None,
#                agent_interface_format=None,
#                discount=1.,
#                discount_zero_after_timeout=False,
#                visualize=False,
#                step_mul=None,
#                realtime=False,
#                save_replay_episodes=0,
#                replay_dir=None,
#                game_steps_per_episode=None,
#                score_index=None,
#                score_multiplier=None,
#                random_seed=None,
#                disable_fog=False,
#                ensure_available_actions=True,
#                version=None):
#   def save_replay(self, *args, **kwargs):
#   def _default_observation(self, obs_spec, agent_index):
# 
# Path: pysc2/env/sc2_env.py
# class Race(enum.IntEnum):
# class Difficulty(enum.IntEnum):
# class BotBuild(enum.IntEnum):
# class Agent(collections.namedtuple("Agent", ["race", "name"])):
# class Bot(collections.namedtuple("Bot", ["race", "difficulty", "build"])):
# class SC2Env(environment.Base):
# def to_list(arg):
# def get_default(a, b):
#   def __new__(cls, race, name=None):
#   def __new__(cls, race, difficulty, build=None):
#   def __init__(self,  # pylint: disable=invalid-name
#                _only_use_kwargs=None,
#                map_name=None,
#                battle_net_map=False,
#                players=None,
#                agent_interface_format=None,
#                discount=1.,
#                discount_zero_after_timeout=False,
#                visualize=False,
#                step_mul=None,
#                realtime=False,
#                save_replay_episodes=0,
#                replay_dir=None,
#                replay_prefix=None,
#                game_steps_per_episode=None,
#                score_index=None,
#                score_multiplier=None,
#                random_seed=None,
#                disable_fog=False,
#                ensure_available_actions=True,
#                version=None):
#   def _finalize(self, visualize):
#   def _get_interface(agent_interface_format, require_raw):
#   def _launch_game(self):
#   def _create_join(self):
#   def map_name(self):
#   def game_info(self):
#   def static_data(self):
#   def observation_spec(self):
#   def action_spec(self):
#   def action_delays(self):
#   def _restart(self):
#   def reset(self):
#   def step(self, actions, step_mul=None):
#   def _step(self, step_mul=None):
#   def _apply_action_delays(self, actions):
#   def _send_delayed_actions(self, up_to_game_loop, current_game_loop):
#   def _step_to(self, game_loop, current_game_loop):
#   def _get_observations(self, target_game_loop):
#     def parallel_observe(c, f):
#   def _observe(self, target_game_loop):
#     def zero_on_first_step(value):
#   def send_chat_messages(self, messages, broadcast=True):
#   def save_replay(self, replay_dir, prefix=None):
#   def close(self):
# def crop_and_deduplicate_names(names):
# REALTIME_GAME_LOOP_SECONDS = 1 / 22.4
# MAX_STEP_COUNT = 524000  # The game fails above 2^19=524288 steps.
# NUM_ACTION_DELAY_BUCKETS = 10


from absl.testing import absltest
from pysc2.env import mock_sc2_env
from pysc2.env import sc2_env
class TestCompareEnvironments(absltest.TestCase):

  @classmethod
  def setUpClass(cls):
    super(TestCompareEnvironments, cls).setUpClass()
    players = [
        sc2_env.Agent(race=sc2_env.Race.terran),
        sc2_env.Agent(race=sc2_env.Race.protoss),
    ]
    kwargs = {
        'map_name': 'Flat64',
        'players': players,
        'agent_interface_format': [
            sc2_env.AgentInterfaceFormat(
                feature_dimensions=sc2_env.Dimensions(
                    screen=(32, 64),
                    minimap=(8, 16)
                ),
                rgb_dimensions=sc2_env.Dimensions(
                    screen=(31, 63),
                    minimap=(7, 15)
                ),
                action_space=sc2_env.ActionSpace.FEATURES
            ),
            sc2_env.AgentInterfaceFormat(
                rgb_dimensions=sc2_env.Dimensions(screen=64, minimap=32)
            )
        ]
    }
    cls._env = sc2_env.SC2Env(**kwargs)

# Path: pysc2/env/mock_sc2_env.py
# DUMMY_MAP_SIZE = point.Point(256, 256)
# class _TestEnvironment(environment.Base):
# class SC2TestEnv(_TestEnvironment):
#   def __init__(self, num_agents, observation_spec, action_spec):
#   def reset(self):
#   def step(self, actions, step_mul=None):
#   def action_spec(self):
#   def observation_spec(self):
#   def _default_observation(self, obs_spec, agent_index):
#   def __init__(self,
#                _only_use_kwargs=None,
#                map_name=None,
#                players=None,
#                agent_interface_format=None,
#                discount=1.,
#                discount_zero_after_timeout=False,
#                visualize=False,
#                step_mul=None,
#                realtime=False,
#                save_replay_episodes=0,
#                replay_dir=None,
#                game_steps_per_episode=None,
#                score_index=None,
#                score_multiplier=None,
#                random_seed=None,
#                disable_fog=False,
#                ensure_available_actions=True,
#                version=None):
#   def save_replay(self, *args, **kwargs):
#   def _default_observation(self, obs_spec, agent_index):
# 
# Path: pysc2/env/sc2_env.py
# class Race(enum.IntEnum):
# class Difficulty(enum.IntEnum):
# class BotBuild(enum.IntEnum):
# class Agent(collections.namedtuple("Agent", ["race", "name"])):
# class Bot(collections.namedtuple("Bot", ["race", "difficulty", "build"])):
# class SC2Env(environment.Base):
# def to_list(arg):
# def get_default(a, b):
#   def __new__(cls, race, name=None):
#   def __new__(cls, race, difficulty, build=None):
#   def __init__(self,  # pylint: disable=invalid-name
#                _only_use_kwargs=None,
#                map_name=None,
#                battle_net_map=False,
#                players=None,
#                agent_interface_format=None,
#                discount=1.,
#                discount_zero_after_timeout=False,
#                visualize=False,
#                step_mul=None,
#                realtime=False,
#                save_replay_episodes=0,
#                replay_dir=None,
#                replay_prefix=None,
#                game_steps_per_episode=None,
#                score_index=None,
#                score_multiplier=None,
#                random_seed=None,
#                disable_fog=False,
#                ensure_available_actions=True,
#                version=None):
#   def _finalize(self, visualize):
#   def _get_interface(agent_interface_format, require_raw):
#   def _launch_game(self):
#   def _create_join(self):
#   def map_name(self):
#   def game_info(self):
#   def static_data(self):
#   def observation_spec(self):
#   def action_spec(self):
#   def action_delays(self):
#   def _restart(self):
#   def reset(self):
#   def step(self, actions, step_mul=None):
#   def _step(self, step_mul=None):
#   def _apply_action_delays(self, actions):
#   def _send_delayed_actions(self, up_to_game_loop, current_game_loop):
#   def _step_to(self, game_loop, current_game_loop):
#   def _get_observations(self, target_game_loop):
#     def parallel_observe(c, f):
#   def _observe(self, target_game_loop):
#     def zero_on_first_step(value):
#   def send_chat_messages(self, messages, broadcast=True):
#   def save_replay(self, replay_dir, prefix=None):
#   def close(self):
# def crop_and_deduplicate_names(names):
# REALTIME_GAME_LOOP_SECONDS = 1 / 22.4
# MAX_STEP_COUNT = 524000  # The game fails above 2^19=524288 steps.
# NUM_ACTION_DELAY_BUCKETS = 10


# Path: pysc2/env/mock_sc2_env_comparison_test.py
from absl.testing import absltest
from pysc2.env import mock_sc2_env
from pysc2.env import sc2_env

class TestCompareEnvironments(absltest.TestCase):

  @classmethod
  def setUpClass(cls):
    super(TestCompareEnvironments, cls).setUpClass()
    players = [
        sc2_env.Agent(race=sc2_env.Race.terran),
        sc2_env.Agent(race=sc2_env.Race.protoss),
    ]
    kwargs = {
        'map_name': 'Flat64',
        'players': players,
        'agent_interface_format': [
            sc2_env.AgentInterfaceFormat(
                feature_dimensions=sc2_env.Dimensions(
                    screen=(32, 64),
                    minimap=(8, 16)
                ),
                rgb_dimensions=sc2_env.Dimensions(
                    screen=(31, 63),
                    minimap=(7, 15)
                ),
                action_space=sc2_env.ActionSpace.FEATURES
            ),
            sc2_env.AgentInterfaceFormat(
                rgb_dimensions=sc2_env.Dimensions(screen=64, minimap=32)
            )
        ]
    }
    cls._env = sc2_env.SC2Env(**kwargs)

    cls._mock_env = mock_sc2_env.SC2TestEnv(**kwargs)