diff --git a/src/ale/ale_interface.hpp b/src/ale/ale_interface.hpp index dba8d187..850b9219 100644 --- a/src/ale/ale_interface.hpp +++ b/src/ale/ale_interface.hpp @@ -89,7 +89,7 @@ class ALEInterface { reward_t act( Action a_action, float a_paddle_strength = 1.0, - Action b_action = PLAYER_B_NOOP, + Action b_action = NOOP, float b_paddle_strength = 0.0 ); diff --git a/src/ale/common/Constants.cpp b/src/ale/common/Constants.cpp index c9e172be..f1c9387f 100644 --- a/src/ale/common/Constants.cpp +++ b/src/ale/common/Constants.cpp @@ -22,51 +22,33 @@ namespace ale { std::string action_to_string(Action a) { static std::string tmp_action_to_string[] = { - "PLAYER_A_NOOP", - "PLAYER_A_FIRE", - "PLAYER_A_UP", - "PLAYER_A_RIGHT", - "PLAYER_A_LEFT", - "PLAYER_A_DOWN", - "PLAYER_A_UPRIGHT", - "PLAYER_A_UPLEFT", - "PLAYER_A_DOWNRIGHT", - "PLAYER_A_DOWNLEFT", - "PLAYER_A_UPFIRE", - "PLAYER_A_RIGHTFIRE", - "PLAYER_A_LEFTFIRE", - "PLAYER_A_DOWNFIRE", - "PLAYER_A_UPRIGHTFIRE", - "PLAYER_A_UPLEFTFIRE", - "PLAYER_A_DOWNRIGHTFIRE", - "PLAYER_A_DOWNLEFTFIRE", - "PLAYER_B_NOOP", - "PLAYER_B_FIRE", - "PLAYER_B_UP", - "PLAYER_B_RIGHT", - "PLAYER_B_LEFT", - "PLAYER_B_DOWN", - "PLAYER_B_UPRIGHT", - "PLAYER_B_UPLEFT", - "PLAYER_B_DOWNRIGHT", - "PLAYER_B_DOWNLEFT", - "PLAYER_B_UPFIRE", - "PLAYER_B_RIGHTFIRE", - "PLAYER_B_LEFTFIRE", - "PLAYER_B_DOWNFIRE", - "PLAYER_B_UPRIGHTFIRE", - "PLAYER_B_UPLEFTFIRE", - "PLAYER_B_DOWNRIGHTFIRE", - "PLAYER_B_DOWNLEFTFIRE", - "__invalid__", // 36 - "__invalid__", // 37 - "__invalid__", // 38 - "__invalid__", // 39 - "RESET", // 40 - "UNDEFINED", // 41 - "RANDOM", // 42 + "NOOP", + "FIRE", + "UP", + "RIGHT", + "LEFT", + "DOWN", + "UPRIGHT", + "UPLEFT", + "DOWNRIGHT", + "DOWNLEFT", + "UPFIRE", + "RIGHTFIRE", + "LEFTFIRE", + "DOWNFIRE", + "UPRIGHTFIRE", + "UPLEFTFIRE", + "DOWNRIGHTFIRE", + "DOWNLEFTFIRE", + "RESET", // 18 + "UNDEFINED", // 19 + "RANDOM", // 20 + "__invalid__", // 21 + "__invalid__", // 22 + "__invalid__", // 23 + "__invalid__", // 24 }; - assert(a >= 0 && a <= 42); + assert(a >= 0 && a <= 24); return tmp_action_to_string[a]; } diff --git a/src/ale/common/Constants.h b/src/ale/common/Constants.h index 72ddb647..8b92605f 100644 --- a/src/ale/common/Constants.h +++ b/src/ale/common/Constants.h @@ -24,53 +24,34 @@ namespace ale { // Define actions enum Action { - PLAYER_A_NOOP = 0, - PLAYER_A_FIRE = 1, - PLAYER_A_UP = 2, - PLAYER_A_RIGHT = 3, - PLAYER_A_LEFT = 4, - PLAYER_A_DOWN = 5, - PLAYER_A_UPRIGHT = 6, - PLAYER_A_UPLEFT = 7, - PLAYER_A_DOWNRIGHT = 8, - PLAYER_A_DOWNLEFT = 9, - PLAYER_A_UPFIRE = 10, - PLAYER_A_RIGHTFIRE = 11, - PLAYER_A_LEFTFIRE = 12, - PLAYER_A_DOWNFIRE = 13, - PLAYER_A_UPRIGHTFIRE = 14, - PLAYER_A_UPLEFTFIRE = 15, - PLAYER_A_DOWNRIGHTFIRE = 16, - PLAYER_A_DOWNLEFTFIRE = 17, - PLAYER_B_NOOP = 18, - PLAYER_B_FIRE = 19, - PLAYER_B_UP = 20, - PLAYER_B_RIGHT = 21, - PLAYER_B_LEFT = 22, - PLAYER_B_DOWN = 23, - PLAYER_B_UPRIGHT = 24, - PLAYER_B_UPLEFT = 25, - PLAYER_B_DOWNRIGHT = 26, - PLAYER_B_DOWNLEFT = 27, - PLAYER_B_UPFIRE = 28, - PLAYER_B_RIGHTFIRE = 29, - PLAYER_B_LEFTFIRE = 30, - PLAYER_B_DOWNFIRE = 31, - PLAYER_B_UPRIGHTFIRE = 32, - PLAYER_B_UPLEFTFIRE = 33, - PLAYER_B_DOWNRIGHTFIRE = 34, - PLAYER_B_DOWNLEFTFIRE = 35, - RESET = 40, // MGB: Use SYSTEM_RESET to reset the environment. - UNDEFINED = 41, - RANDOM = 42, - SAVE_STATE = 43, - LOAD_STATE = 44, - SYSTEM_RESET = 45, - LAST_ACTION_INDEX = 50 + NOOP = 0, + FIRE = 1, + UP = 2, + RIGHT = 3, + LEFT = 4, + DOWN = 5, + UPRIGHT = 6, + UPLEFT = 7, + DOWNRIGHT = 8, + DOWNLEFT = 9, + UPFIRE = 10, + RIGHTFIRE = 11, + LEFTFIRE = 12, + DOWNFIRE = 13, + UPRIGHTFIRE = 14, + UPLEFTFIRE = 15, + DOWNRIGHTFIRE = 16, + DOWNLEFTFIRE = 17, + RESET = 18, // MGB: Use SYSTEM_RESET to reset the environment. + UNDEFINED = 19, + RANDOM = 20, + SAVE_STATE = 21, + LOAD_STATE = 22, + SYSTEM_RESET = 23, + LAST_ACTION_INDEX = 24 }; -#define PLAYER_A_MAX (18) -#define PLAYER_B_MAX (36) +#define ACTION_MAX (18) std::string action_to_string(Action a); diff --git a/src/ale/environment/ale_state.cpp b/src/ale/environment/ale_state.cpp index f1530954..fc82f360 100644 --- a/src/ale/environment/ale_state.cpp +++ b/src/ale/environment/ale_state.cpp @@ -198,21 +198,21 @@ void ALEState::applyActionPaddles(Event* event, int delta_a = 0; int delta_b = 0; switch (player_a_action) { - case PLAYER_A_RIGHT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_UPRIGHT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: + case RIGHT: + case RIGHTFIRE: + case UPRIGHT: + case DOWNRIGHT: + case UPRIGHTFIRE: + case DOWNRIGHTFIRE: delta_a = static_cast(-PADDLE_DELTA * fabs(paddle_a_strength)); break; - case PLAYER_A_LEFT: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case LEFT: + case LEFTFIRE: + case UPLEFT: + case DOWNLEFT: + case UPLEFTFIRE: + case DOWNLEFTFIRE: delta_a = static_cast(PADDLE_DELTA * fabs(paddle_a_strength)); break; @@ -221,21 +221,21 @@ void ALEState::applyActionPaddles(Event* event, } switch (player_b_action) { - case PLAYER_B_RIGHT: - case PLAYER_B_RIGHTFIRE: - case PLAYER_B_UPRIGHT: - case PLAYER_B_DOWNRIGHT: - case PLAYER_B_UPRIGHTFIRE: - case PLAYER_B_DOWNRIGHTFIRE: + case RIGHT: + case RIGHTFIRE: + case UPRIGHT: + case DOWNRIGHT: + case UPRIGHTFIRE: + case DOWNRIGHTFIRE: delta_b = static_cast(-PADDLE_DELTA * fabs(paddle_b_strength)); break; - case PLAYER_B_LEFT: - case PLAYER_B_LEFTFIRE: - case PLAYER_B_UPLEFT: - case PLAYER_B_DOWNLEFT: - case PLAYER_B_UPLEFTFIRE: - case PLAYER_B_DOWNLEFTFIRE: + case LEFT: + case LEFTFIRE: + case UPLEFT: + case DOWNLEFT: + case UPLEFTFIRE: + case DOWNLEFTFIRE: delta_b = static_cast(PADDLE_DELTA * fabs(paddle_b_strength)); break; @@ -252,15 +252,15 @@ void ALEState::applyActionPaddles(Event* event, // Now add the fire event switch (player_a_action) { - case PLAYER_A_FIRE: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case FIRE: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: event->set(Event::PaddleZeroFire, 1); break; default: @@ -269,15 +269,15 @@ void ALEState::applyActionPaddles(Event* event, } switch (player_b_action) { - case PLAYER_B_FIRE: - case PLAYER_B_UPFIRE: - case PLAYER_B_RIGHTFIRE: - case PLAYER_B_LEFTFIRE: - case PLAYER_B_DOWNFIRE: - case PLAYER_B_UPRIGHTFIRE: - case PLAYER_B_UPLEFTFIRE: - case PLAYER_B_DOWNRIGHTFIRE: - case PLAYER_B_DOWNLEFTFIRE: + case FIRE: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: event->set(Event::PaddleOneFire, 1); break; default: @@ -305,71 +305,71 @@ void ALEState::applyActionJoysticks(Event* event, // Reset keys resetKeys(event); switch (player_a_action) { - case PLAYER_A_NOOP: + case NOOP: break; - case PLAYER_A_FIRE: + case FIRE: event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_UP: + case UP: event->set(Event::JoystickZeroUp, 1); break; - case PLAYER_A_RIGHT: + case RIGHT: event->set(Event::JoystickZeroRight, 1); break; - case PLAYER_A_LEFT: + case LEFT: event->set(Event::JoystickZeroLeft, 1); break; - case PLAYER_A_DOWN: + case DOWN: event->set(Event::JoystickZeroDown, 1); break; - case PLAYER_A_UPRIGHT: + case UPRIGHT: event->set(Event::JoystickZeroUp, 1); event->set(Event::JoystickZeroRight, 1); break; - case PLAYER_A_UPLEFT: + case UPLEFT: event->set(Event::JoystickZeroUp, 1); event->set(Event::JoystickZeroLeft, 1); break; - case PLAYER_A_DOWNRIGHT: + case DOWNRIGHT: event->set(Event::JoystickZeroDown, 1); event->set(Event::JoystickZeroRight, 1); break; - case PLAYER_A_DOWNLEFT: + case DOWNLEFT: event->set(Event::JoystickZeroDown, 1); event->set(Event::JoystickZeroLeft, 1); break; - case PLAYER_A_UPFIRE: + case UPFIRE: event->set(Event::JoystickZeroUp, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_RIGHTFIRE: + case RIGHTFIRE: event->set(Event::JoystickZeroRight, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_LEFTFIRE: + case LEFTFIRE: event->set(Event::JoystickZeroLeft, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_DOWNFIRE: + case DOWNFIRE: event->set(Event::JoystickZeroDown, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_UPRIGHTFIRE: + case UPRIGHTFIRE: event->set(Event::JoystickZeroUp, 1); event->set(Event::JoystickZeroRight, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_UPLEFTFIRE: + case UPLEFTFIRE: event->set(Event::JoystickZeroUp, 1); event->set(Event::JoystickZeroLeft, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_DOWNRIGHTFIRE: + case DOWNRIGHTFIRE: event->set(Event::JoystickZeroDown, 1); event->set(Event::JoystickZeroRight, 1); event->set(Event::JoystickZeroFire, 1); break; - case PLAYER_A_DOWNLEFTFIRE: + case DOWNLEFTFIRE: event->set(Event::JoystickZeroDown, 1); event->set(Event::JoystickZeroLeft, 1); event->set(Event::JoystickZeroFire, 1); @@ -383,71 +383,71 @@ void ALEState::applyActionJoysticks(Event* event, std::exit(-1); } switch (player_b_action) { - case PLAYER_B_NOOP: + case NOOP: break; - case PLAYER_B_FIRE: + case FIRE: event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_UP: + case UP: event->set(Event::JoystickOneUp, 1); break; - case PLAYER_B_RIGHT: + case RIGHT: event->set(Event::JoystickOneRight, 1); break; - case PLAYER_B_LEFT: + case LEFT: event->set(Event::JoystickOneLeft, 1); break; - case PLAYER_B_DOWN: + case DOWN: event->set(Event::JoystickOneDown, 1); break; - case PLAYER_B_UPRIGHT: + case UPRIGHT: event->set(Event::JoystickOneUp, 1); event->set(Event::JoystickOneRight, 1); break; - case PLAYER_B_UPLEFT: + case UPLEFT: event->set(Event::JoystickOneUp, 1); event->set(Event::JoystickOneLeft, 1); break; - case PLAYER_B_DOWNRIGHT: + case DOWNRIGHT: event->set(Event::JoystickOneDown, 1); event->set(Event::JoystickOneRight, 1); break; - case PLAYER_B_DOWNLEFT: + case DOWNLEFT: event->set(Event::JoystickOneDown, 1); event->set(Event::JoystickOneLeft, 1); break; - case PLAYER_B_UPFIRE: + case UPFIRE: event->set(Event::JoystickOneUp, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_RIGHTFIRE: + case RIGHTFIRE: event->set(Event::JoystickOneRight, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_LEFTFIRE: + case LEFTFIRE: event->set(Event::JoystickOneLeft, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_DOWNFIRE: + case DOWNFIRE: event->set(Event::JoystickOneDown, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_UPRIGHTFIRE: + case UPRIGHTFIRE: event->set(Event::JoystickOneUp, 1); event->set(Event::JoystickOneRight, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_UPLEFTFIRE: + case UPLEFTFIRE: event->set(Event::JoystickOneUp, 1); event->set(Event::JoystickOneLeft, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_DOWNRIGHTFIRE: + case DOWNRIGHTFIRE: event->set(Event::JoystickOneDown, 1); event->set(Event::JoystickOneRight, 1); event->set(Event::JoystickOneFire, 1); break; - case PLAYER_B_DOWNLEFTFIRE: + case DOWNLEFTFIRE: event->set(Event::JoystickOneDown, 1); event->set(Event::JoystickOneLeft, 1); event->set(Event::JoystickOneFire, 1); diff --git a/src/ale/environment/stella_environment.cpp b/src/ale/environment/stella_environment.cpp index 5ac44174..5247c43a 100644 --- a/src/ale/environment/stella_environment.cpp +++ b/src/ale/environment/stella_environment.cpp @@ -34,8 +34,8 @@ StellaEnvironment::StellaEnvironment(OSystem* osystem, RomSettings* settings) m_phosphor_blend(osystem), m_screen(m_osystem->console().mediaSource().height(), m_osystem->console().mediaSource().width()), - m_player_a_action(PLAYER_A_NOOP), - m_player_b_action(PLAYER_B_NOOP) { + m_player_a_action(NOOP), + m_player_b_action(NOOP) { // Determine whether this is a paddle-based game if (m_osystem->console().properties().get(Controller_Left) == "PADDLES" || m_osystem->console().properties().get(Controller_Right) == "PADDLES") { @@ -110,7 +110,7 @@ void StellaEnvironment::reset() { int noopSteps; noopSteps = 60; - emulate(PLAYER_A_NOOP, PLAYER_B_NOOP, 1.0, 1.0, noopSteps); + emulate(NOOP, NOOP, 1.0, 1.0, noopSteps); // Reset the emulator softReset(); @@ -125,7 +125,7 @@ void StellaEnvironment::reset() { // Apply necessary actions specified by the rom itself ActionVect startingActions = m_settings->getStartingActions(); for (size_t i = 0; i < startingActions.size(); i++) { - emulate(startingActions[i], PLAYER_B_NOOP, 1.0, 1.0); + emulate(startingActions[i], NOOP, 1.0, 1.0); } } @@ -140,19 +140,19 @@ void StellaEnvironment::restoreState(const ALEState& target_state) { void StellaEnvironment::noopIllegalActions(Action& player_a_action, Action& player_b_action) { - if (player_a_action < (Action)PLAYER_B_NOOP && + if (player_a_action < (Action)NOOP && !m_settings->isLegal(player_a_action)) { - player_a_action = (Action)PLAYER_A_NOOP; + player_a_action = (Action)NOOP; } // Also drop RESET, which doesn't play nice with our clean notions of RL environments else if (player_a_action == RESET) - player_a_action = (Action)PLAYER_A_NOOP; + player_a_action = (Action)NOOP; if (player_b_action < (Action)RESET && - !m_settings->isLegal((Action)((int)player_b_action - PLAYER_B_NOOP))) { - player_b_action = (Action)PLAYER_B_NOOP; + !m_settings->isLegal((Action)((int)player_b_action - NOOP))) { + player_b_action = (Action)NOOP; } else if (player_b_action == RESET) - player_b_action = (Action)PLAYER_B_NOOP; + player_b_action = (Action)NOOP; } reward_t StellaEnvironment::act(Action player_a_action, Action player_b_action, @@ -200,11 +200,11 @@ reward_t StellaEnvironment::act(Action player_a_action, Action player_b_action, /** This functions emulates a push on the reset button of the console */ void StellaEnvironment::softReset() { - emulate(RESET, PLAYER_B_NOOP, 1.0, 1.0, m_num_reset_steps); + emulate(RESET, NOOP, 1.0, 1.0, m_num_reset_steps); // Reset previous actions to NOOP for correct action repeating - m_player_a_action = PLAYER_A_NOOP; - m_player_b_action = PLAYER_B_NOOP; + m_player_a_action = NOOP; + m_player_b_action = NOOP; } /** Applies the given actions (e.g. updating paddle positions when the paddle is used) @@ -258,7 +258,7 @@ void StellaEnvironment::pressSelect(size_t num_steps) { } processScreen(); processRAM(); - emulate(PLAYER_A_NOOP, PLAYER_B_NOOP, 1.0, 1.0); + emulate(NOOP, NOOP, 1.0, 1.0); m_state.incrementFrame(); } diff --git a/src/ale/games/RomSettings.cpp b/src/ale/games/RomSettings.cpp index aa6089e3..0ff1ff9b 100644 --- a/src/ale/games/RomSettings.cpp +++ b/src/ale/games/RomSettings.cpp @@ -31,7 +31,7 @@ bool RomSettings::isLegal(const Action& a) const { ActionVect RomSettings::getMinimalActionSet() { ActionVect actions; - for (int a = 0; a < PLAYER_B_NOOP; a++) { + for (int a = 0; a < RESET; a++) { if (isMinimal((Action)a) && isLegal((Action)a)) { actions.push_back((Action)a); } @@ -41,7 +41,7 @@ ActionVect RomSettings::getMinimalActionSet() { ActionVect RomSettings::getAllActions() { ActionVect actions; - for (int a = 0; a < PLAYER_B_NOOP; a++) { + for (int a = 0; a < RESET; a++) { if (isLegal((Action)a)) { actions.push_back((Action)a); } diff --git a/src/ale/games/supported/Adventure.cpp b/src/ale/games/supported/Adventure.cpp index f09ad458..7e576975 100644 --- a/src/ale/games/supported/Adventure.cpp +++ b/src/ale/games/supported/Adventure.cpp @@ -62,24 +62,24 @@ reward_t AdventureSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AdventureSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -138,7 +138,7 @@ void AdventureSettings::setMode( environment->pressSelect(2 + rng.next() % 256); // Adventure uses a debouncer so need to wait before the select takes // effect. - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(NOOP, NOOP); mode = (readRam(&system, 0xDD) >> 1) & 0x03; } // Reset the environment to apply changes. diff --git a/src/ale/games/supported/AirRaid.cpp b/src/ale/games/supported/AirRaid.cpp index 6fb8fd20..e1225e1d 100644 --- a/src/ale/games/supported/AirRaid.cpp +++ b/src/ale/games/supported/AirRaid.cpp @@ -45,12 +45,12 @@ reward_t AirRaidSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AirRaidSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -80,7 +80,7 @@ void AirRaidSettings::loadState(Deserializer& ser) { ActionVect AirRaidSettings::getStartingActions() { ActionVect startingActions; - startingActions.push_back(PLAYER_A_FIRE); + startingActions.push_back(FIRE); return startingActions; } diff --git a/src/ale/games/supported/Alien.cpp b/src/ale/games/supported/Alien.cpp index c92db4dc..f82709ef 100644 --- a/src/ale/games/supported/Alien.cpp +++ b/src/ale/games/supported/Alien.cpp @@ -68,24 +68,24 @@ reward_t AlienSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AlienSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Amidar.cpp b/src/ale/games/supported/Amidar.cpp index 58362c8f..b0bb3ff3 100644 --- a/src/ale/games/supported/Amidar.cpp +++ b/src/ale/games/supported/Amidar.cpp @@ -64,16 +64,16 @@ reward_t AmidarSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AmidarSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Assault.cpp b/src/ale/games/supported/Assault.cpp index f55e7b54..d92be8df 100644 --- a/src/ale/games/supported/Assault.cpp +++ b/src/ale/games/supported/Assault.cpp @@ -60,13 +60,13 @@ reward_t AssaultSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AssaultSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Asterix.cpp b/src/ale/games/supported/Asterix.cpp index 94346598..4b4d370f 100644 --- a/src/ale/games/supported/Asterix.cpp +++ b/src/ale/games/supported/Asterix.cpp @@ -65,15 +65,15 @@ reward_t AsterixSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AsterixSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; @@ -105,7 +105,7 @@ void AsterixSettings::loadState(Deserializer& ser) { } ActionVect AsterixSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } } // namespace ale diff --git a/src/ale/games/supported/Asteroids.cpp b/src/ale/games/supported/Asteroids.cpp index 7554fef1..c69b7718 100644 --- a/src/ale/games/supported/Asteroids.cpp +++ b/src/ale/games/supported/Asteroids.cpp @@ -68,20 +68,20 @@ reward_t AsteroidsSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AsteroidsSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Atlantis.cpp b/src/ale/games/supported/Atlantis.cpp index b039613f..e619be07 100644 --- a/src/ale/games/supported/Atlantis.cpp +++ b/src/ale/games/supported/Atlantis.cpp @@ -73,10 +73,10 @@ reward_t AtlantisSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool AtlantisSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Atlantis2.cpp b/src/ale/games/supported/Atlantis2.cpp index d2736214..e5372625 100644 --- a/src/ale/games/supported/Atlantis2.cpp +++ b/src/ale/games/supported/Atlantis2.cpp @@ -69,10 +69,10 @@ reward_t Atlantis2Settings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool Atlantis2Settings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Backgammon.cpp b/src/ale/games/supported/Backgammon.cpp index c9c43856..9587dc91 100644 --- a/src/ale/games/supported/Backgammon.cpp +++ b/src/ale/games/supported/Backgammon.cpp @@ -122,9 +122,9 @@ reward_t BackgammonSettings::getReward() const { return m_reward; } bool BackgammonSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: + case FIRE: + case RIGHT: + case LEFT: return true; default: return false; diff --git a/src/ale/games/supported/BankHeist.cpp b/src/ale/games/supported/BankHeist.cpp index 1854ab5e..2bbf3b99 100644 --- a/src/ale/games/supported/BankHeist.cpp +++ b/src/ale/games/supported/BankHeist.cpp @@ -62,24 +62,24 @@ reward_t BankHeistSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BankHeistSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/BasicMath.cpp b/src/ale/games/supported/BasicMath.cpp index bb28c1ff..b0a7ac21 100644 --- a/src/ale/games/supported/BasicMath.cpp +++ b/src/ale/games/supported/BasicMath.cpp @@ -52,12 +52,12 @@ reward_t BasicMathSettings::getReward() const { return m_reward; } bool BasicMathSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: // Fire button is select in this game so doesn't make sense to move // and press fire at the same time. return true; diff --git a/src/ale/games/supported/BattleZone.cpp b/src/ale/games/supported/BattleZone.cpp index 1b530739..6dc930cf 100644 --- a/src/ale/games/supported/BattleZone.cpp +++ b/src/ale/games/supported/BattleZone.cpp @@ -78,24 +78,24 @@ reward_t BattleZoneSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BattleZoneSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/BeamRider.cpp b/src/ale/games/supported/BeamRider.cpp index dcc1037e..1c9bb45b 100644 --- a/src/ale/games/supported/BeamRider.cpp +++ b/src/ale/games/supported/BeamRider.cpp @@ -71,15 +71,15 @@ reward_t BeamRiderSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BeamRiderSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case UPRIGHT: + case UPLEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -111,7 +111,7 @@ void BeamRiderSettings::loadState(Deserializer& ser) { } ActionVect BeamRiderSettings::getStartingActions() { - return {PLAYER_A_RIGHT}; + return {RIGHT}; } DifficultyVect BeamRiderSettings::getAvailableDifficulties() { diff --git a/src/ale/games/supported/Berzerk.cpp b/src/ale/games/supported/Berzerk.cpp index aaf18e75..37e219b3 100644 --- a/src/ale/games/supported/Berzerk.cpp +++ b/src/ale/games/supported/Berzerk.cpp @@ -62,24 +62,24 @@ reward_t BerzerkSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BerzerkSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -131,7 +131,7 @@ void BerzerkSettings::setMode( if (m >= 1 && (m <= 9 || m == 0x10 || m == 0x11 || m == 0x12)) { // we wait that the game is ready to change mode for (unsigned int i = 0; i < 20; i++) { - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(NOOP, NOOP); } // read the mode we are currently in unsigned char mode = readRam(&system, 0x80); diff --git a/src/ale/games/supported/Blackjack.cpp b/src/ale/games/supported/Blackjack.cpp index 9986949b..6249f238 100644 --- a/src/ale/games/supported/Blackjack.cpp +++ b/src/ale/games/supported/Blackjack.cpp @@ -54,10 +54,10 @@ reward_t BlackjackSettings::getReward() const { return m_reward; } bool BlackjackSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case UP: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/Bowling.cpp b/src/ale/games/supported/Bowling.cpp index ee453c60..82c2f9ed 100644 --- a/src/ale/games/supported/Bowling.cpp +++ b/src/ale/games/supported/Bowling.cpp @@ -45,12 +45,12 @@ reward_t BowlingSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BowlingSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case DOWN: + case UPFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Boxing.cpp b/src/ale/games/supported/Boxing.cpp index 5d41cc83..26f4c6b7 100644 --- a/src/ale/games/supported/Boxing.cpp +++ b/src/ale/games/supported/Boxing.cpp @@ -60,24 +60,24 @@ reward_t BoxingSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BoxingSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Breakout.cpp b/src/ale/games/supported/Breakout.cpp index 2a35d1d4..1ed07809 100644 --- a/src/ale/games/supported/Breakout.cpp +++ b/src/ale/games/supported/Breakout.cpp @@ -66,10 +66,10 @@ reward_t BreakoutSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool BreakoutSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: return true; default: return false; diff --git a/src/ale/games/supported/Carnival.cpp b/src/ale/games/supported/Carnival.cpp index 21cecafa..08247861 100644 --- a/src/ale/games/supported/Carnival.cpp +++ b/src/ale/games/supported/Carnival.cpp @@ -46,12 +46,12 @@ reward_t CarnivalSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool CarnivalSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Casino.cpp b/src/ale/games/supported/Casino.cpp index 2688c070..ea6011bf 100644 --- a/src/ale/games/supported/Casino.cpp +++ b/src/ale/games/supported/Casino.cpp @@ -75,10 +75,10 @@ reward_t CasinoSettings::getReward() const { return m_reward; } // all possible betting actions. Recommend setting paddle_max = 1290196. bool CasinoSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case UP: + case DOWN: return true; default: return false; @@ -146,11 +146,11 @@ void CasinoSettings::setMode( ActionVect CasinoSettings::getStartingActions() { // Need to wait for one second (60 frames) for the cards to be shuffled. - ActionVect startingActions(60, PLAYER_A_NOOP); + ActionVect startingActions(60, NOOP); // Press fire for a couple of frames to enter player A into the game. - startingActions.push_back(PLAYER_A_FIRE); - startingActions.push_back(PLAYER_A_FIRE); + startingActions.push_back(FIRE); + startingActions.push_back(FIRE); return startingActions; } diff --git a/src/ale/games/supported/Centipede.cpp b/src/ale/games/supported/Centipede.cpp index 0c2043be..9e5420f9 100644 --- a/src/ale/games/supported/Centipede.cpp +++ b/src/ale/games/supported/Centipede.cpp @@ -67,24 +67,24 @@ reward_t CentipedeSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool CentipedeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/ChopperCommand.cpp b/src/ale/games/supported/ChopperCommand.cpp index 9b253326..fdff06d8 100644 --- a/src/ale/games/supported/ChopperCommand.cpp +++ b/src/ale/games/supported/ChopperCommand.cpp @@ -77,24 +77,24 @@ reward_t ChopperCommandSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool ChopperCommandSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/CrazyClimber.cpp b/src/ale/games/supported/CrazyClimber.cpp index 4569e0e8..dfb05f57 100644 --- a/src/ale/games/supported/CrazyClimber.cpp +++ b/src/ale/games/supported/CrazyClimber.cpp @@ -71,15 +71,15 @@ reward_t CrazyClimberSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool CrazyClimberSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/Crossbow.cpp b/src/ale/games/supported/Crossbow.cpp index 9322f231..ef714d67 100644 --- a/src/ale/games/supported/Crossbow.cpp +++ b/src/ale/games/supported/Crossbow.cpp @@ -53,24 +53,24 @@ reward_t CrossbowSettings::getReward() const { return m_reward; } bool CrossbowSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/DarkChambers.cpp b/src/ale/games/supported/DarkChambers.cpp index 7bf25f50..89100652 100644 --- a/src/ale/games/supported/DarkChambers.cpp +++ b/src/ale/games/supported/DarkChambers.cpp @@ -69,24 +69,24 @@ reward_t DarkChambersSettings::getReward() const { return m_reward; } bool DarkChambersSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -132,7 +132,7 @@ ActionVect DarkChambersSettings::getStartingActions() { // When this ROM is booted there is a short animation sequence before any // user input is accepted, even the 'start' button. This lasts for around // 8 seconds so we wait for 486 frames. - return ActionVect(486, PLAYER_A_NOOP); + return ActionVect(486, NOOP); } } // namespace ale diff --git a/src/ale/games/supported/Defender.cpp b/src/ale/games/supported/Defender.cpp index 421e5540..19291de3 100644 --- a/src/ale/games/supported/Defender.cpp +++ b/src/ale/games/supported/Defender.cpp @@ -68,24 +68,24 @@ reward_t DefenderSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool DefenderSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/DemonAttack.cpp b/src/ale/games/supported/DemonAttack.cpp index 7ccdd004..9161a7f3 100644 --- a/src/ale/games/supported/DemonAttack.cpp +++ b/src/ale/games/supported/DemonAttack.cpp @@ -70,12 +70,12 @@ reward_t DemonAttackSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool DemonAttackSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/DonkeyKong.cpp b/src/ale/games/supported/DonkeyKong.cpp index 9caabe79..6359f350 100644 --- a/src/ale/games/supported/DonkeyKong.cpp +++ b/src/ale/games/supported/DonkeyKong.cpp @@ -48,24 +48,24 @@ reward_t DonkeyKongSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool DonkeyKongSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/DoubleDunk.cpp b/src/ale/games/supported/DoubleDunk.cpp index c2832f8f..0b56d7a5 100644 --- a/src/ale/games/supported/DoubleDunk.cpp +++ b/src/ale/games/supported/DoubleDunk.cpp @@ -47,24 +47,24 @@ reward_t DoubleDunkSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool DoubleDunkSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -93,7 +93,7 @@ void DoubleDunkSettings::loadState(Deserializer& ser) { } ActionVect DoubleDunkSettings::getStartingActions() { - return {PLAYER_A_UPFIRE}; + return {UPFIRE}; } // returns a list of mode that the game can be played in @@ -114,8 +114,8 @@ void DoubleDunkSettings::goDown( // this function goes to the next option in the menu int previousSelection = readRam(&system, 0xB0); while (previousSelection == readRam(&system, 0xB0)) { - environment->act(PLAYER_A_DOWN, PLAYER_B_NOOP); - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(DOWN, NOOP); + environment->act(NOOP, NOOP); } } @@ -125,8 +125,8 @@ void DoubleDunkSettings::activateOption( // once we are at the proper option in the menu, // if we want to enable it all we have to do is to go right while ((readRam(&system, 0x80) & bitOfInterest) != bitOfInterest) { - environment->act(PLAYER_A_RIGHT, PLAYER_B_NOOP); - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(RIGHT, NOOP); + environment->act(NOOP, NOOP); } } @@ -136,8 +136,8 @@ void DoubleDunkSettings::deactivateOption( // once we are at the proper optio in the menu, // if we want to disable it all we have to do is to go left while ((readRam(&system, 0x80) & bitOfInterest) == bitOfInterest) { - environment->act(PLAYER_A_LEFT, PLAYER_B_NOOP); - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(LEFT, NOOP); + environment->act(NOOP, NOOP); } } @@ -187,8 +187,8 @@ void DoubleDunkSettings::setMode( //reset the environment to apply changes. environment->softReset(); //apply starting action - environment->act(PLAYER_A_UPFIRE, PLAYER_B_NOOP); - environment->act(PLAYER_A_NOOP, PLAYER_B_NOOP); + environment->act(UPFIRE, NOOP); + environment->act(NOOP, NOOP); } else { throw std::runtime_error("This mode doesn't currently exist for this game"); diff --git a/src/ale/games/supported/Earthworld.cpp b/src/ale/games/supported/Earthworld.cpp index 11249d36..60516316 100644 --- a/src/ale/games/supported/Earthworld.cpp +++ b/src/ale/games/supported/Earthworld.cpp @@ -51,24 +51,24 @@ reward_t EarthworldSettings::getReward() const { return m_reward; } bool EarthworldSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/ElevatorAction.cpp b/src/ale/games/supported/ElevatorAction.cpp index 25628da0..0bc739cc 100644 --- a/src/ale/games/supported/ElevatorAction.cpp +++ b/src/ale/games/supported/ElevatorAction.cpp @@ -61,24 +61,24 @@ reward_t ElevatorActionSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool ElevatorActionSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -110,7 +110,7 @@ void ElevatorActionSettings::loadState(Deserializer& ser) { } ActionVect ElevatorActionSettings::getStartingActions() { - return ActionVect(16, PLAYER_A_FIRE); + return ActionVect(16, FIRE); } } // namespace ale diff --git a/src/ale/games/supported/Enduro.cpp b/src/ale/games/supported/Enduro.cpp index 5bf47332..e0a589fd 100644 --- a/src/ale/games/supported/Enduro.cpp +++ b/src/ale/games/supported/Enduro.cpp @@ -67,15 +67,15 @@ reward_t EnduroSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool EnduroSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case DOWN: + case DOWNRIGHT: + case DOWNLEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -104,7 +104,7 @@ void EnduroSettings::loadState(Deserializer& ser) { } ActionVect EnduroSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } } // namespace ale diff --git a/src/ale/games/supported/Entombed.cpp b/src/ale/games/supported/Entombed.cpp index bc172d3a..c829a75e 100644 --- a/src/ale/games/supported/Entombed.cpp +++ b/src/ale/games/supported/Entombed.cpp @@ -53,24 +53,24 @@ reward_t EntombedSettings::getReward() const { return m_reward; } bool EntombedSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -105,8 +105,7 @@ DifficultyVect EntombedSettings::getAvailableDifficulties() { // Need to press 'fire' to start, not 'reset', then wait a few frames for the // game state to be set up. ActionVect EntombedSettings::getStartingActions() { - return {PLAYER_A_FIRE, PLAYER_A_NOOP, PLAYER_A_NOOP, PLAYER_A_NOOP, - PLAYER_A_NOOP, PLAYER_A_NOOP}; + return {FIRE, NOOP, NOOP, NOOP, NOOP, NOOP}; } } // namespace ale diff --git a/src/ale/games/supported/Et.cpp b/src/ale/games/supported/Et.cpp index efa9013a..9abe85b8 100644 --- a/src/ale/games/supported/Et.cpp +++ b/src/ale/games/supported/Et.cpp @@ -62,24 +62,24 @@ reward_t EtSettings::getReward() const { return m_reward; } bool EtSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/FishingDerby.cpp b/src/ale/games/supported/FishingDerby.cpp index fa98e550..6faca08a 100644 --- a/src/ale/games/supported/FishingDerby.cpp +++ b/src/ale/games/supported/FishingDerby.cpp @@ -51,24 +51,24 @@ reward_t FishingDerbySettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool FishingDerbySettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/FlagCapture.cpp b/src/ale/games/supported/FlagCapture.cpp index 536036dc..9ae92d64 100644 --- a/src/ale/games/supported/FlagCapture.cpp +++ b/src/ale/games/supported/FlagCapture.cpp @@ -50,24 +50,24 @@ reward_t FlagCaptureSettings::getReward() const { return m_reward; } bool FlagCaptureSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Freeway.cpp b/src/ale/games/supported/Freeway.cpp index dede340c..7a4b1490 100644 --- a/src/ale/games/supported/Freeway.cpp +++ b/src/ale/games/supported/Freeway.cpp @@ -55,9 +55,9 @@ reward_t FreewaySettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool FreewaySettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_DOWN: + case NOOP: + case UP: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/Frogger.cpp b/src/ale/games/supported/Frogger.cpp index d9ab78c7..00817322 100644 --- a/src/ale/games/supported/Frogger.cpp +++ b/src/ale/games/supported/Frogger.cpp @@ -46,11 +46,11 @@ reward_t FroggerSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool FroggerSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/Frostbite.cpp b/src/ale/games/supported/Frostbite.cpp index 188e01a6..bb6604e6 100644 --- a/src/ale/games/supported/Frostbite.cpp +++ b/src/ale/games/supported/Frostbite.cpp @@ -66,24 +66,24 @@ reward_t FrostbiteSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool FrostbiteSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Galaxian.cpp b/src/ale/games/supported/Galaxian.cpp index e5f60bbf..90e59e57 100644 --- a/src/ale/games/supported/Galaxian.cpp +++ b/src/ale/games/supported/Galaxian.cpp @@ -76,12 +76,12 @@ reward_t GalaxianSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool GalaxianSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHT: - case PLAYER_A_FIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_RIGHTFIRE: + case NOOP: + case LEFT: + case RIGHT: + case FIRE: + case LEFTFIRE: + case RIGHTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Gopher.cpp b/src/ale/games/supported/Gopher.cpp index 30ad3872..a512c183 100644 --- a/src/ale/games/supported/Gopher.cpp +++ b/src/ale/games/supported/Gopher.cpp @@ -65,14 +65,14 @@ reward_t GopherSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool GopherSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -104,7 +104,7 @@ void GopherSettings::loadState(Deserializer& ser) { } ActionVect GopherSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } // returns a list of mode that the game can be played in diff --git a/src/ale/games/supported/Gravitar.cpp b/src/ale/games/supported/Gravitar.cpp index 8437a89d..203ad944 100644 --- a/src/ale/games/supported/Gravitar.cpp +++ b/src/ale/games/supported/Gravitar.cpp @@ -66,24 +66,24 @@ reward_t GravitarSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool GravitarSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -115,7 +115,7 @@ void GravitarSettings::loadState(Deserializer& ser) { } ActionVect GravitarSettings::getStartingActions() { - return ActionVect(16, PLAYER_A_FIRE); + return ActionVect(16, FIRE); } // returns a list of mode that the game can be played in diff --git a/src/ale/games/supported/Hangman.cpp b/src/ale/games/supported/Hangman.cpp index 59a1e8af..247268a9 100644 --- a/src/ale/games/supported/Hangman.cpp +++ b/src/ale/games/supported/Hangman.cpp @@ -130,24 +130,24 @@ reward_t HangmanSettings::getReward() const { /* is an action part of the minimal set? */ bool HangmanSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/HauntedHouse.cpp b/src/ale/games/supported/HauntedHouse.cpp index ef91bbd0..92c65694 100644 --- a/src/ale/games/supported/HauntedHouse.cpp +++ b/src/ale/games/supported/HauntedHouse.cpp @@ -64,24 +64,24 @@ reward_t HauntedHouseSettings::getReward() const { return m_reward; } bool HauntedHouseSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Hero.cpp b/src/ale/games/supported/Hero.cpp index dd60104c..8e737d06 100644 --- a/src/ale/games/supported/Hero.cpp +++ b/src/ale/games/supported/Hero.cpp @@ -61,24 +61,24 @@ reward_t HeroSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool HeroSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/HumanCannonball.cpp b/src/ale/games/supported/HumanCannonball.cpp index c00e71f1..d54499c5 100644 --- a/src/ale/games/supported/HumanCannonball.cpp +++ b/src/ale/games/supported/HumanCannonball.cpp @@ -51,24 +51,24 @@ reward_t HumanCannonballSettings::getReward() const { return m_reward; } bool HumanCannonballSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/IceHockey.cpp b/src/ale/games/supported/IceHockey.cpp index baf3480e..ccada570 100644 --- a/src/ale/games/supported/IceHockey.cpp +++ b/src/ale/games/supported/IceHockey.cpp @@ -52,24 +52,24 @@ reward_t IceHockeySettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool IceHockeySettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/JamesBond.cpp b/src/ale/games/supported/JamesBond.cpp index 25234c13..cf1d3bb7 100644 --- a/src/ale/games/supported/JamesBond.cpp +++ b/src/ale/games/supported/JamesBond.cpp @@ -67,24 +67,24 @@ reward_t JamesBondSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool JamesBondSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/JourneyEscape.cpp b/src/ale/games/supported/JourneyEscape.cpp index a478e29b..d5318b0b 100644 --- a/src/ale/games/supported/JourneyEscape.cpp +++ b/src/ale/games/supported/JourneyEscape.cpp @@ -51,22 +51,22 @@ reward_t JourneyEscapeSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool JourneyEscapeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -95,7 +95,7 @@ void JourneyEscapeSettings::loadState(Deserializer& ser) { } ActionVect JourneyEscapeSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } DifficultyVect JourneyEscapeSettings::getAvailableDifficulties() { diff --git a/src/ale/games/supported/Kaboom.cpp b/src/ale/games/supported/Kaboom.cpp index 77d57af3..4b8aff16 100644 --- a/src/ale/games/supported/Kaboom.cpp +++ b/src/ale/games/supported/Kaboom.cpp @@ -47,10 +47,10 @@ reward_t KaboomSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KaboomSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: return true; default: return false; @@ -79,7 +79,7 @@ void KaboomSettings::loadState(Deserializer& ser) { } ActionVect KaboomSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } } // namespace ale diff --git a/src/ale/games/supported/Kangaroo.cpp b/src/ale/games/supported/Kangaroo.cpp index 68bd45d6..622eba32 100644 --- a/src/ale/games/supported/Kangaroo.cpp +++ b/src/ale/games/supported/Kangaroo.cpp @@ -63,24 +63,24 @@ reward_t KangarooSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KangarooSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/KeystoneKapers.cpp b/src/ale/games/supported/KeystoneKapers.cpp index b99f55a3..5fcf9d76 100644 --- a/src/ale/games/supported/KeystoneKapers.cpp +++ b/src/ale/games/supported/KeystoneKapers.cpp @@ -45,20 +45,20 @@ reward_t KeystoneKapersSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KeystoneKapersSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Kingkong.cpp b/src/ale/games/supported/Kingkong.cpp index 3c7b6fd7..3961d8f7 100644 --- a/src/ale/games/supported/Kingkong.cpp +++ b/src/ale/games/supported/Kingkong.cpp @@ -61,12 +61,12 @@ reward_t KingkongSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KingkongSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/Klax.cpp b/src/ale/games/supported/Klax.cpp index d95c4686..0c2a5e32 100644 --- a/src/ale/games/supported/Klax.cpp +++ b/src/ale/games/supported/Klax.cpp @@ -97,24 +97,24 @@ reward_t KlaxSettings::getReward() const { return m_reward; } bool KlaxSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -160,7 +160,7 @@ void KlaxSettings::setMode( } ActionVect KlaxSettings::getStartingActions() { - return {PLAYER_A_FIRE, PLAYER_A_NOOP}; + return {FIRE, NOOP}; } } // namespace ale diff --git a/src/ale/games/supported/Koolaid.cpp b/src/ale/games/supported/Koolaid.cpp index faf68479..6174f358 100644 --- a/src/ale/games/supported/Koolaid.cpp +++ b/src/ale/games/supported/Koolaid.cpp @@ -45,15 +45,15 @@ reward_t KoolaidSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KoolaidSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/Krull.cpp b/src/ale/games/supported/Krull.cpp index 9ea0c16f..664cfd42 100644 --- a/src/ale/games/supported/Krull.cpp +++ b/src/ale/games/supported/Krull.cpp @@ -64,24 +64,24 @@ reward_t KrullSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KrullSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/KungFuMaster.cpp b/src/ale/games/supported/KungFuMaster.cpp index 2841f0fa..cc30f755 100644 --- a/src/ale/games/supported/KungFuMaster.cpp +++ b/src/ale/games/supported/KungFuMaster.cpp @@ -62,20 +62,20 @@ reward_t KungFuMasterSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool KungFuMasterSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case DOWNRIGHT: + case DOWNLEFT: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/LaserGates.cpp b/src/ale/games/supported/LaserGates.cpp index 91061560..168d4de0 100644 --- a/src/ale/games/supported/LaserGates.cpp +++ b/src/ale/games/supported/LaserGates.cpp @@ -45,24 +45,24 @@ reward_t LaserGatesSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool LaserGatesSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/LostLuggage.cpp b/src/ale/games/supported/LostLuggage.cpp index 764d65a5..82934d3b 100644 --- a/src/ale/games/supported/LostLuggage.cpp +++ b/src/ale/games/supported/LostLuggage.cpp @@ -47,15 +47,15 @@ reward_t LostLuggageSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool LostLuggageSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; @@ -65,15 +65,15 @@ bool LostLuggageSettings::isMinimal(const Action& a) const { bool LostLuggageSettings::isLegal(const Action& a) const { switch (a) { // Don't allow pressing 'fire' - case PLAYER_A_FIRE: - case PLAYER_A_UPFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: + case FIRE: + case UPFIRE: + case DOWNFIRE: + case LEFTFIRE: + case RIGHTFIRE: + case UPLEFTFIRE: + case UPRIGHTFIRE: + case DOWNLEFTFIRE: + case DOWNRIGHTFIRE: return false; default: return true; @@ -105,7 +105,7 @@ void LostLuggageSettings::loadState(Deserializer& ser) { } ActionVect LostLuggageSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } // According to https://atariage.com/manual_html_page.php?SoftwareLabelID=277 diff --git a/src/ale/games/supported/MarioBros.cpp b/src/ale/games/supported/MarioBros.cpp index 04ae805d..0edae3fa 100644 --- a/src/ale/games/supported/MarioBros.cpp +++ b/src/ale/games/supported/MarioBros.cpp @@ -51,24 +51,24 @@ reward_t MarioBrosSettings::getReward() const { return m_reward; } bool MarioBrosSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -126,10 +126,10 @@ ActionVect MarioBrosSettings::getStartingActions() { // in order to begin. ActionVect startingActions; for (int i = 0; i < 10; ++i) { - startingActions.push_back(PLAYER_A_NOOP); + startingActions.push_back(NOOP); } for (int i = 0; i < 7; ++i) { - startingActions.push_back(PLAYER_A_FIRE); + startingActions.push_back(FIRE); } return startingActions; } diff --git a/src/ale/games/supported/MiniatureGolf.cpp b/src/ale/games/supported/MiniatureGolf.cpp index 35ac1867..e04c0c5b 100644 --- a/src/ale/games/supported/MiniatureGolf.cpp +++ b/src/ale/games/supported/MiniatureGolf.cpp @@ -95,24 +95,24 @@ reward_t MiniatureGolfSettings::getReward() const { return m_reward; } bool MiniatureGolfSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/MontezumaRevenge.cpp b/src/ale/games/supported/MontezumaRevenge.cpp index 2a9febae..e813b123 100644 --- a/src/ale/games/supported/MontezumaRevenge.cpp +++ b/src/ale/games/supported/MontezumaRevenge.cpp @@ -65,24 +65,24 @@ reward_t MontezumaRevengeSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool MontezumaRevengeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/MrDo.cpp b/src/ale/games/supported/MrDo.cpp index 2df3c0f2..3634a61b 100644 --- a/src/ale/games/supported/MrDo.cpp +++ b/src/ale/games/supported/MrDo.cpp @@ -47,16 +47,16 @@ reward_t MrDoSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool MrDoSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; @@ -88,7 +88,7 @@ void MrDoSettings::loadState(Deserializer& ser) { } ActionVect MrDoSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } // According to https://atariage.com/manual_html_page.php?SoftwareLabelID=318 diff --git a/src/ale/games/supported/MsPacman.cpp b/src/ale/games/supported/MsPacman.cpp index 4bb4aa15..08867ccb 100644 --- a/src/ale/games/supported/MsPacman.cpp +++ b/src/ale/games/supported/MsPacman.cpp @@ -65,15 +65,15 @@ reward_t MsPacmanSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool MsPacmanSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/NameThisGame.cpp b/src/ale/games/supported/NameThisGame.cpp index cd3f02a5..8c7076a7 100644 --- a/src/ale/games/supported/NameThisGame.cpp +++ b/src/ale/games/supported/NameThisGame.cpp @@ -61,12 +61,12 @@ reward_t NameThisGameSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool NameThisGameSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Othello.cpp b/src/ale/games/supported/Othello.cpp index 1852fe38..c127446f 100644 --- a/src/ale/games/supported/Othello.cpp +++ b/src/ale/games/supported/Othello.cpp @@ -65,16 +65,16 @@ reward_t OthelloSettings::getReward() const { return m_reward; } bool OthelloSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: // The joystick is used to move the active square on the board, then // fire selects that square. It does not make sense to press fire and // move at the same time. diff --git a/src/ale/games/supported/Pacman.cpp b/src/ale/games/supported/Pacman.cpp index 4be1110f..875bbbc9 100644 --- a/src/ale/games/supported/Pacman.cpp +++ b/src/ale/games/supported/Pacman.cpp @@ -67,11 +67,11 @@ reward_t PacmanSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PacmanSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/Phoenix.cpp b/src/ale/games/supported/Phoenix.cpp index 5307520c..6125fd8d 100644 --- a/src/ale/games/supported/Phoenix.cpp +++ b/src/ale/games/supported/Phoenix.cpp @@ -65,14 +65,14 @@ reward_t PhoenixSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PhoenixSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case DOWN: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Pitfall.cpp b/src/ale/games/supported/Pitfall.cpp index 7d787d93..18cf0cbd 100644 --- a/src/ale/games/supported/Pitfall.cpp +++ b/src/ale/games/supported/Pitfall.cpp @@ -65,24 +65,24 @@ reward_t PitfallSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PitfallSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -114,7 +114,7 @@ void PitfallSettings::loadState(Deserializer& ser) { } ActionVect PitfallSettings::getStartingActions() { - return {PLAYER_A_UP}; + return {UP}; } } // namespace ale diff --git a/src/ale/games/supported/Pitfall2.cpp b/src/ale/games/supported/Pitfall2.cpp index 03af7b44..968a9364 100644 --- a/src/ale/games/supported/Pitfall2.cpp +++ b/src/ale/games/supported/Pitfall2.cpp @@ -67,24 +67,24 @@ reward_t Pitfall2Settings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool Pitfall2Settings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -116,7 +116,7 @@ void Pitfall2Settings::loadState(Deserializer& ser) { } ActionVect Pitfall2Settings::getStartingActions() { - return {PLAYER_A_UP}; + return {UP}; } } // namespace ale diff --git a/src/ale/games/supported/Pong.cpp b/src/ale/games/supported/Pong.cpp index 9a058a38..81a01bf0 100644 --- a/src/ale/games/supported/Pong.cpp +++ b/src/ale/games/supported/Pong.cpp @@ -47,12 +47,12 @@ reward_t PongSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PongSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Pooyan.cpp b/src/ale/games/supported/Pooyan.cpp index a96c6472..5a707a55 100644 --- a/src/ale/games/supported/Pooyan.cpp +++ b/src/ale/games/supported/Pooyan.cpp @@ -64,12 +64,12 @@ reward_t PooyanSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PooyanSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case DOWN: + case UPFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/PrivateEye.cpp b/src/ale/games/supported/PrivateEye.cpp index 3ee982f8..09e10df6 100644 --- a/src/ale/games/supported/PrivateEye.cpp +++ b/src/ale/games/supported/PrivateEye.cpp @@ -47,24 +47,24 @@ reward_t PrivateEyeSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool PrivateEyeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -93,7 +93,7 @@ void PrivateEyeSettings::loadState(Deserializer& ser) { } ActionVect PrivateEyeSettings::getStartingActions() { - return {PLAYER_A_UP}; + return {UP}; } // returns a list of mode that the game can be played in diff --git a/src/ale/games/supported/QBert.cpp b/src/ale/games/supported/QBert.cpp index a87fc64e..d0df838e 100644 --- a/src/ale/games/supported/QBert.cpp +++ b/src/ale/games/supported/QBert.cpp @@ -77,12 +77,12 @@ reward_t QBertSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool QBertSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/RiverRaid.cpp b/src/ale/games/supported/RiverRaid.cpp index f2b69fe3..fd9395fa 100644 --- a/src/ale/games/supported/RiverRaid.cpp +++ b/src/ale/games/supported/RiverRaid.cpp @@ -94,24 +94,24 @@ reward_t RiverRaidSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool RiverRaidSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/RoadRunner.cpp b/src/ale/games/supported/RoadRunner.cpp index a991da73..4e272266 100644 --- a/src/ale/games/supported/RoadRunner.cpp +++ b/src/ale/games/supported/RoadRunner.cpp @@ -75,24 +75,24 @@ reward_t RoadRunnerSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool RoadRunnerSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/RoboTank.cpp b/src/ale/games/supported/RoboTank.cpp index 005214ee..df1d02c7 100644 --- a/src/ale/games/supported/RoboTank.cpp +++ b/src/ale/games/supported/RoboTank.cpp @@ -66,24 +66,24 @@ reward_t RoboTankSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool RoboTankSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Seaquest.cpp b/src/ale/games/supported/Seaquest.cpp index d04d2e88..1387ff35 100644 --- a/src/ale/games/supported/Seaquest.cpp +++ b/src/ale/games/supported/Seaquest.cpp @@ -60,24 +60,24 @@ reward_t SeaquestSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SeaquestSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/SirLancelot.cpp b/src/ale/games/supported/SirLancelot.cpp index 339cdefc..7301ee69 100644 --- a/src/ale/games/supported/SirLancelot.cpp +++ b/src/ale/games/supported/SirLancelot.cpp @@ -46,12 +46,12 @@ reward_t SirLancelotSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SirLancelotSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -83,7 +83,7 @@ void SirLancelotSettings::loadState(Deserializer& ser) { } ActionVect SirLancelotSettings::getStartingActions() { - return {RESET, PLAYER_A_LEFT}; + return {RESET, LEFT}; } } // namespace ale diff --git a/src/ale/games/supported/Skiing.cpp b/src/ale/games/supported/Skiing.cpp index 98b860bf..34aa5978 100644 --- a/src/ale/games/supported/Skiing.cpp +++ b/src/ale/games/supported/Skiing.cpp @@ -48,9 +48,9 @@ reward_t SkiingSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SkiingSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: + case NOOP: + case RIGHT: + case LEFT: return true; default: return false; @@ -60,15 +60,15 @@ bool SkiingSettings::isMinimal(const Action& a) const { bool SkiingSettings::isLegal(const Action& a) const { switch (a) { // Don't allow pressing 'fire' - case PLAYER_A_FIRE: - case PLAYER_A_UPFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: + case FIRE: + case UPFIRE: + case DOWNFIRE: + case LEFTFIRE: + case RIGHTFIRE: + case UPLEFTFIRE: + case UPRIGHTFIRE: + case DOWNLEFTFIRE: + case DOWNRIGHTFIRE: return false; default: return true; @@ -97,7 +97,7 @@ void SkiingSettings::loadState(Deserializer& ser) { } ActionVect SkiingSettings::getStartingActions() { - return ActionVect(16, PLAYER_A_DOWN); + return ActionVect(16, DOWN); } } // namespace ale diff --git a/src/ale/games/supported/Solaris.cpp b/src/ale/games/supported/Solaris.cpp index 66988dc7..5c448cbc 100644 --- a/src/ale/games/supported/Solaris.cpp +++ b/src/ale/games/supported/Solaris.cpp @@ -65,24 +65,24 @@ reward_t SolarisSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SolarisSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/SpaceInvaders.cpp b/src/ale/games/supported/SpaceInvaders.cpp index 946f2bc4..9a8745ea 100644 --- a/src/ale/games/supported/SpaceInvaders.cpp +++ b/src/ale/games/supported/SpaceInvaders.cpp @@ -71,12 +71,12 @@ reward_t SpaceInvadersSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SpaceInvadersSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHT: - case PLAYER_A_FIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_RIGHTFIRE: + case NOOP: + case LEFT: + case RIGHT: + case FIRE: + case LEFTFIRE: + case RIGHTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/SpaceWar.cpp b/src/ale/games/supported/SpaceWar.cpp index e3094ec6..d66f2cbd 100644 --- a/src/ale/games/supported/SpaceWar.cpp +++ b/src/ale/games/supported/SpaceWar.cpp @@ -53,24 +53,24 @@ reward_t SpaceWarSettings::getReward() const { return m_reward; } bool SpaceWarSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/StarGunner.cpp b/src/ale/games/supported/StarGunner.cpp index f163d55a..f6a162a8 100644 --- a/src/ale/games/supported/StarGunner.cpp +++ b/src/ale/games/supported/StarGunner.cpp @@ -81,24 +81,24 @@ reward_t StarGunnerSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool StarGunnerSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Superman.cpp b/src/ale/games/supported/Superman.cpp index d85ef500..c3a59d6d 100644 --- a/src/ale/games/supported/Superman.cpp +++ b/src/ale/games/supported/Superman.cpp @@ -58,24 +58,24 @@ reward_t SupermanSettings::getReward() const { return m_reward; } bool SupermanSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Surround.cpp b/src/ale/games/supported/Surround.cpp index 8e80fed3..9a1c4346 100644 --- a/src/ale/games/supported/Surround.cpp +++ b/src/ale/games/supported/Surround.cpp @@ -63,11 +63,11 @@ reward_t SurroundSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool SurroundSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_LEFT: - case PLAYER_A_RIGHT: - case PLAYER_A_UP: - case PLAYER_A_DOWN: + case NOOP: + case LEFT: + case RIGHT: + case UP: + case DOWN: return true; default: return false; @@ -106,7 +106,7 @@ DifficultyVect SurroundSettings::getAvailableDifficulties() { // https://atariage.com/manual_html_page.php?SoftwareLabelID=535 // There are only two single player modes, the second is faster than the first. ModeVect SurroundSettings::getAvailableModes() { - return {0, 2}; + return {0, 2, 4}; } void SurroundSettings::setMode( diff --git a/src/ale/games/supported/Tennis.cpp b/src/ale/games/supported/Tennis.cpp index c6212eb5..09c34d89 100644 --- a/src/ale/games/supported/Tennis.cpp +++ b/src/ale/games/supported/Tennis.cpp @@ -61,24 +61,24 @@ reward_t TennisSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TennisSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Tetris.cpp b/src/ale/games/supported/Tetris.cpp index 08aa1e3c..756ad956 100644 --- a/src/ale/games/supported/Tetris.cpp +++ b/src/ale/games/supported/Tetris.cpp @@ -71,11 +71,11 @@ reward_t TetrisSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TetrisSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: + case NOOP: + case FIRE: + case RIGHT: + case LEFT: + case DOWN: return true; default: return false; diff --git a/src/ale/games/supported/TicTacToe3d.cpp b/src/ale/games/supported/TicTacToe3d.cpp index a45d7317..c1e49d05 100644 --- a/src/ale/games/supported/TicTacToe3d.cpp +++ b/src/ale/games/supported/TicTacToe3d.cpp @@ -69,16 +69,16 @@ reward_t TicTacToe3dSettings::getReward() const { return m_reward; } bool TicTacToe3dSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/TimePilot.cpp b/src/ale/games/supported/TimePilot.cpp index ef293e4c..8c40cb1c 100644 --- a/src/ale/games/supported/TimePilot.cpp +++ b/src/ale/games/supported/TimePilot.cpp @@ -67,16 +67,16 @@ reward_t TimePilotSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TimePilotSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Trondead.cpp b/src/ale/games/supported/Trondead.cpp index d26c6344..3eb611d3 100644 --- a/src/ale/games/supported/Trondead.cpp +++ b/src/ale/games/supported/Trondead.cpp @@ -47,24 +47,24 @@ reward_t TrondeadSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TrondeadSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/Turmoil.cpp b/src/ale/games/supported/Turmoil.cpp index 5c2f9732..69914d7d 100644 --- a/src/ale/games/supported/Turmoil.cpp +++ b/src/ale/games/supported/Turmoil.cpp @@ -50,18 +50,18 @@ reward_t TurmoilSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TurmoilSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; @@ -93,7 +93,7 @@ void TurmoilSettings::loadState(Deserializer& ser) { } ActionVect TurmoilSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } // According to https://atariage.com/manual_html_page.php?SoftwareLabelID=571 diff --git a/src/ale/games/supported/Tutankham.cpp b/src/ale/games/supported/Tutankham.cpp index 1c120fcf..9f3d2c0a 100644 --- a/src/ale/games/supported/Tutankham.cpp +++ b/src/ale/games/supported/Tutankham.cpp @@ -66,14 +66,14 @@ reward_t TutankhamSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool TutankhamSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/UpNDown.cpp b/src/ale/games/supported/UpNDown.cpp index c9613b25..46107974 100644 --- a/src/ale/games/supported/UpNDown.cpp +++ b/src/ale/games/supported/UpNDown.cpp @@ -64,12 +64,12 @@ reward_t UpNDownSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool UpNDownSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case DOWN: + case UPFIRE: + case DOWNFIRE: return true; default: return false; @@ -101,7 +101,7 @@ void UpNDownSettings::loadState(Deserializer& ser) { } ActionVect UpNDownSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } DifficultyVect UpNDownSettings::getAvailableDifficulties() { diff --git a/src/ale/games/supported/Venture.cpp b/src/ale/games/supported/Venture.cpp index d1b93180..a0671d14 100644 --- a/src/ale/games/supported/Venture.cpp +++ b/src/ale/games/supported/Venture.cpp @@ -66,24 +66,24 @@ reward_t VentureSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool VentureSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/VideoCheckers.cpp b/src/ale/games/supported/VideoCheckers.cpp index 2b98ea1a..e144bf3c 100644 --- a/src/ale/games/supported/VideoCheckers.cpp +++ b/src/ale/games/supported/VideoCheckers.cpp @@ -85,11 +85,11 @@ reward_t VideoCheckersSettings::getReward() const { return m_reward; } bool VideoCheckersSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_FIRE: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case FIRE: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/VideoChess.cpp b/src/ale/games/supported/VideoChess.cpp index d276b7a8..459ace91 100644 --- a/src/ale/games/supported/VideoChess.cpp +++ b/src/ale/games/supported/VideoChess.cpp @@ -91,16 +91,16 @@ reward_t VideoChessSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool VideoChessSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: return true; default: return false; diff --git a/src/ale/games/supported/VideoCube.cpp b/src/ale/games/supported/VideoCube.cpp index 2aee5b3f..f524ecbb 100644 --- a/src/ale/games/supported/VideoCube.cpp +++ b/src/ale/games/supported/VideoCube.cpp @@ -141,24 +141,24 @@ reward_t VideoCubeSettings::getReward() const { return m_reward; } bool VideoCubeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -195,12 +195,12 @@ ActionVect VideoCubeSettings::getStartingActions() { // fire button being pressed to confirm the selection and start the game. // We do the cube selection in setMode, but force a "fire button" press after // approximately a second of waiting about. - ActionVect startingActions(61, PLAYER_A_NOOP); + ActionVect startingActions(61, NOOP); // Press fire to start and wait a couple of frames. - startingActions.push_back(PLAYER_A_FIRE); - startingActions.push_back(PLAYER_A_NOOP); - startingActions.push_back(PLAYER_A_NOOP); + startingActions.push_back(FIRE); + startingActions.push_back(NOOP); + startingActions.push_back(NOOP); return startingActions; } @@ -266,7 +266,7 @@ void VideoCubeSettings::setMode( // Press "right" until the correct cube is selected. unsigned char cube = getDecimalScore(0x9f, &system); while (cube != m_cubeNumber) { - environment->act(PLAYER_A_RIGHT, PLAYER_B_NOOP); + environment->act(RIGHT, NOOP); cube = getDecimalScore(0x9f, &system); } } else { diff --git a/src/ale/games/supported/VideoPinball.cpp b/src/ale/games/supported/VideoPinball.cpp index d3f26018..698d1171 100644 --- a/src/ale/games/supported/VideoPinball.cpp +++ b/src/ale/games/supported/VideoPinball.cpp @@ -68,15 +68,15 @@ reward_t VideoPinballSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool VideoPinballSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: return true; default: return false; diff --git a/src/ale/games/supported/WizardOfWor.cpp b/src/ale/games/supported/WizardOfWor.cpp index 6d273b26..f30f78af 100644 --- a/src/ale/games/supported/WizardOfWor.cpp +++ b/src/ale/games/supported/WizardOfWor.cpp @@ -72,16 +72,16 @@ reward_t WizardOfWorSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool WizardOfWorSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: return true; default: return false; diff --git a/src/ale/games/supported/WordZapper.cpp b/src/ale/games/supported/WordZapper.cpp index 97955121..d936926e 100644 --- a/src/ale/games/supported/WordZapper.cpp +++ b/src/ale/games/supported/WordZapper.cpp @@ -60,24 +60,24 @@ reward_t WordZapperSettings::getReward() const { return m_reward; } bool WordZapperSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -107,12 +107,12 @@ ActionVect WordZapperSettings::getStartingActions() { // user input is accepted, even the 'start' button. This lasts for around // 8 seconds so we wait for 486 frames to be sure our subsequent action to // press 'fire' is effective. - ActionVect startingActions(486, PLAYER_A_NOOP); + ActionVect startingActions(486, NOOP); // Press fire to start and wait a couple of frames. - startingActions.push_back(PLAYER_A_FIRE); - startingActions.push_back(PLAYER_A_NOOP); - startingActions.push_back(PLAYER_A_NOOP); + startingActions.push_back(FIRE); + startingActions.push_back(NOOP); + startingActions.push_back(NOOP); return startingActions; } diff --git a/src/ale/games/supported/YarsRevenge.cpp b/src/ale/games/supported/YarsRevenge.cpp index f9371a47..30914f7e 100644 --- a/src/ale/games/supported/YarsRevenge.cpp +++ b/src/ale/games/supported/YarsRevenge.cpp @@ -63,24 +63,24 @@ reward_t YarsRevengeSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool YarsRevengeSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; @@ -112,7 +112,7 @@ void YarsRevengeSettings::loadState(Deserializer& ser) { } ActionVect YarsRevengeSettings::getStartingActions() { - return {PLAYER_A_FIRE}; + return {FIRE}; } // returns a list of mode that the game can be played in diff --git a/src/ale/games/supported/Zaxxon.cpp b/src/ale/games/supported/Zaxxon.cpp index cbc9f1e3..914665fb 100644 --- a/src/ale/games/supported/Zaxxon.cpp +++ b/src/ale/games/supported/Zaxxon.cpp @@ -66,24 +66,24 @@ reward_t ZaxxonSettings::getReward() const { return m_reward; } /* is an action part of the minimal set? */ bool ZaxxonSettings::isMinimal(const Action& a) const { switch (a) { - case PLAYER_A_NOOP: - case PLAYER_A_FIRE: - case PLAYER_A_UP: - case PLAYER_A_RIGHT: - case PLAYER_A_LEFT: - case PLAYER_A_DOWN: - case PLAYER_A_UPRIGHT: - case PLAYER_A_UPLEFT: - case PLAYER_A_DOWNRIGHT: - case PLAYER_A_DOWNLEFT: - case PLAYER_A_UPFIRE: - case PLAYER_A_RIGHTFIRE: - case PLAYER_A_LEFTFIRE: - case PLAYER_A_DOWNFIRE: - case PLAYER_A_UPRIGHTFIRE: - case PLAYER_A_UPLEFTFIRE: - case PLAYER_A_DOWNRIGHTFIRE: - case PLAYER_A_DOWNLEFTFIRE: + case NOOP: + case FIRE: + case UP: + case RIGHT: + case LEFT: + case DOWN: + case UPRIGHT: + case UPLEFT: + case DOWNRIGHT: + case DOWNLEFT: + case UPFIRE: + case RIGHTFIRE: + case LEFTFIRE: + case DOWNFIRE: + case UPRIGHTFIRE: + case UPLEFTFIRE: + case DOWNRIGHTFIRE: + case DOWNLEFTFIRE: return true; default: return false; diff --git a/src/ale/python/__init__.pyi b/src/ale/python/__init__.pyi index d0ae526c..b44c89c2 100644 --- a/src/ale/python/__init__.pyi +++ b/src/ale/python/__init__.pyi @@ -61,48 +61,25 @@ class Action: """ :type: int """ - PLAYER_A_DOWN: _ale_py.Action # value = - PLAYER_A_DOWNFIRE: _ale_py.Action # value = - PLAYER_A_DOWNLEFT: _ale_py.Action # value = - PLAYER_A_DOWNLEFTFIRE: _ale_py.Action # value = - PLAYER_A_DOWNRIGHT: _ale_py.Action # value = - PLAYER_A_DOWNRIGHTFIRE: ( - _ale_py.Action - ) # value = - PLAYER_A_FIRE: _ale_py.Action # value = - PLAYER_A_LEFT: _ale_py.Action # value = - PLAYER_A_LEFTFIRE: _ale_py.Action # value = - PLAYER_A_NOOP: _ale_py.Action # value = - PLAYER_A_RIGHT: _ale_py.Action # value = - PLAYER_A_RIGHTFIRE: _ale_py.Action # value = - PLAYER_A_UP: _ale_py.Action # value = - PLAYER_A_UPFIRE: _ale_py.Action # value = - PLAYER_A_UPLEFT: _ale_py.Action # value = - PLAYER_A_UPLEFTFIRE: _ale_py.Action # value = - PLAYER_A_UPRIGHT: _ale_py.Action # value = - PLAYER_A_UPRIGHTFIRE: _ale_py.Action # value = - PLAYER_B_DOWN: _ale_py.Action # value = - PLAYER_B_DOWNFIRE: _ale_py.Action # value = - PLAYER_B_DOWNLEFT: _ale_py.Action # value = - PLAYER_B_DOWNLEFTFIRE: _ale_py.Action # value = - PLAYER_B_DOWNRIGHT: _ale_py.Action # value = - PLAYER_B_DOWNRIGHTFIRE: ( - _ale_py.Action - ) # value = - PLAYER_B_FIRE: _ale_py.Action # value = - PLAYER_B_LEFT: _ale_py.Action # value = - PLAYER_B_LEFTFIRE: _ale_py.Action # value = - PLAYER_B_NOOP: _ale_py.Action # value = - PLAYER_B_RIGHT: _ale_py.Action # value = - PLAYER_B_RIGHTFIRE: _ale_py.Action # value = - PLAYER_B_UP: _ale_py.Action # value = - PLAYER_B_UPFIRE: _ale_py.Action # value = - PLAYER_B_UPLEFT: _ale_py.Action # value = - PLAYER_B_UPLEFTFIRE: _ale_py.Action # value = - PLAYER_B_UPRIGHT: _ale_py.Action # value = - PLAYER_B_UPRIGHTFIRE: _ale_py.Action # value = - __members__: dict # value = {'PLAYER_A_NOOP': , 'PLAYER_A_FIRE': , 'PLAYER_A_UP': , 'PLAYER_A_RIGHT': , 'PLAYER_A_LEFT': , 'PLAYER_A_DOWN': , 'PLAYER_A_UPRIGHT': , 'PLAYER_A_UPLEFT': , 'PLAYER_A_DOWNRIGHT': , 'PLAYER_A_DOWNLEFT': , 'PLAYER_A_UPFIRE': , 'PLAYER_A_RIGHTFIRE': , 'PLAYER_A_LEFTFIRE': , 'PLAYER_A_DOWNFIRE': , 'PLAYER_A_UPRIGHTFIRE': , 'PLAYER_A_UPLEFTFIRE': , 'PLAYER_A_DOWNRIGHTFIRE': , 'PLAYER_A_DOWNLEFTFIRE': 'PLAYER_B_NOOP': , 'PLAYER_B_FIRE': , 'PLAYER_B_UP': , 'PLAYER_B_RIGHT': , 'PLAYER_B_LEFT': , 'PLAYER_B_DOWN': , 'PLAYER_B_UPRIGHT': , 'PLAYER_B_UPLEFT': , 'PLAYER_B_DOWNRIGHT': , 'PLAYER_B_DOWNLEFT': , 'PLAYER_B_UPFIRE': , 'PLAYER_B_RIGHTFIRE': , 'PLAYER_B_LEFTFIRE': , 'PLAYER_B_DOWNFIRE': , 'PLAYER_B_UPRIGHTFIRE': , 'PLAYER_B_UPLEFTFIRE': , 'PLAYER_B_DOWNRIGHTFIRE': , 'PLAYER_B_DOWNLEFTFIRE': } - pass + DOWN: _ale_py.Action # value = + DOWNFIRE: _ale_py.Action # value = + DOWNLEFT: _ale_py.Action # value = + DOWNLEFTFIRE: _ale_py.Action # value = + DOWNRIGHT: _ale_py.Action # value = + DOWNRIGHTFIRE: _ale_py.Action # value = + FIRE: _ale_py.Action # value = + LEFT: _ale_py.Action # value = + LEFTFIRE: _ale_py.Action # value = + NOOP: _ale_py.Action # value = + RIGHT: _ale_py.Action # value = + RIGHTFIRE: _ale_py.Action # value = + UP: _ale_py.Action # value = + UPFIRE: _ale_py.Action # value = + UPLEFT: _ale_py.Action # value = + UPLEFTFIRE: _ale_py.Action # value = + UPRIGHT: _ale_py.Action # value = + UPRIGHTFIRE: _ale_py.Action # value = + __members__: dict # value = {'NOOP': , 'FIRE': , 'UP': , 'RIGHT': , 'LEFT': , 'DOWN': , 'UPRIGHT': , 'UPLEFT': , 'DOWNRIGHT': , 'DOWNLEFT': , 'UPFIRE': , 'RIGHTFIRE': , 'LEFTFIRE': , 'DOWNFIRE': , 'UPRIGHTFIRE': , 'UPLEFTFIRE': , 'DOWNRIGHTFIRE': , 'DOWNLEFTFIRE': } pass class ALEState: def __eq__(self, other: ALEState) -> bool: ... @@ -130,7 +107,7 @@ class ALEInterface: self, a_action: Action, a_paddle_strength: float = 1.0, - b_action: Action = Action.PLAYER_B_NOOP, + b_action: Action = Action.NOOP, b_paddle_strength: float = 1.0, ) -> int: ... @overload diff --git a/src/ale/python/ale_python_interface.hpp b/src/ale/python/ale_python_interface.hpp index f09da785..159556f8 100644 --- a/src/ale/python/ale_python_interface.hpp +++ b/src/ale/python/ale_python_interface.hpp @@ -83,42 +83,24 @@ PYBIND11_MODULE(_ale_py, m) { #endif py::enum_(m, "Action") - .value("PLAYER_A_NOOP", ale::PLAYER_A_NOOP) - .value("PLAYER_A_FIRE", ale::PLAYER_A_FIRE) - .value("PLAYER_A_UP", ale::PLAYER_A_UP) - .value("PLAYER_A_RIGHT", ale::PLAYER_A_RIGHT) - .value("PLAYER_A_LEFT", ale::PLAYER_A_LEFT) - .value("PLAYER_A_DOWN", ale::PLAYER_A_DOWN) - .value("PLAYER_A_UPRIGHT", ale::PLAYER_A_UPRIGHT) - .value("PLAYER_A_UPLEFT", ale::PLAYER_A_UPLEFT) - .value("PLAYER_A_DOWNRIGHT", ale::PLAYER_A_DOWNRIGHT) - .value("PLAYER_A_DOWNLEFT", ale::PLAYER_A_DOWNLEFT) - .value("PLAYER_A_UPFIRE", ale::PLAYER_A_UPFIRE) - .value("PLAYER_A_RIGHTFIRE", ale::PLAYER_A_RIGHTFIRE) - .value("PLAYER_A_LEFTFIRE", ale::PLAYER_A_LEFTFIRE) - .value("PLAYER_A_DOWNFIRE", ale::PLAYER_A_DOWNFIRE) - .value("PLAYER_A_UPRIGHTFIRE", ale::PLAYER_A_UPRIGHTFIRE) - .value("PLAYER_A_UPLEFTFIRE", ale::PLAYER_A_UPLEFTFIRE) - .value("PLAYER_A_DOWNRIGHTFIRE", ale::PLAYER_A_DOWNRIGHTFIRE) - .value("PLAYER_A_DOWNLEFTFIRE", ale::PLAYER_A_DOWNLEFTFIRE) - .value("PLAYER_B_NOOP", ale::PLAYER_B_NOOP) - .value("PLAYER_B_FIRE", ale::PLAYER_B_FIRE) - .value("PLAYER_B_UP", ale::PLAYER_B_UP) - .value("PLAYER_B_RIGHT", ale::PLAYER_B_RIGHT) - .value("PLAYER_B_LEFT", ale::PLAYER_B_LEFT) - .value("PLAYER_B_DOWN", ale::PLAYER_B_DOWN) - .value("PLAYER_B_UPRIGHT", ale::PLAYER_B_UPRIGHT) - .value("PLAYER_B_UPLEFT", ale::PLAYER_B_UPLEFT) - .value("PLAYER_B_DOWNRIGHT", ale::PLAYER_B_DOWNRIGHT) - .value("PLAYER_B_DOWNLEFT", ale::PLAYER_B_DOWNLEFT) - .value("PLAYER_B_UPFIRE", ale::PLAYER_B_UPFIRE) - .value("PLAYER_B_RIGHTFIRE", ale::PLAYER_B_RIGHTFIRE) - .value("PLAYER_B_LEFTFIRE", ale::PLAYER_B_LEFTFIRE) - .value("PLAYER_B_DOWNFIRE", ale::PLAYER_B_DOWNFIRE) - .value("PLAYER_B_UPRIGHTFIRE", ale::PLAYER_B_UPRIGHTFIRE) - .value("PLAYER_B_UPLEFTFIRE", ale::PLAYER_B_UPLEFTFIRE) - .value("PLAYER_B_DOWNRIGHTFIRE", ale::PLAYER_B_DOWNRIGHTFIRE) - .value("PLAYER_B_DOWNLEFTFIRE", ale::PLAYER_B_DOWNLEFTFIRE) + .value("NOOP", ale::NOOP) + .value("FIRE", ale::FIRE) + .value("UP", ale::UP) + .value("RIGHT", ale::RIGHT) + .value("LEFT", ale::LEFT) + .value("DOWN", ale::DOWN) + .value("UPRIGHT", ale::UPRIGHT) + .value("UPLEFT", ale::UPLEFT) + .value("DOWNRIGHT", ale::DOWNRIGHT) + .value("DOWNLEFT", ale::DOWNLEFT) + .value("UPFIRE", ale::UPFIRE) + .value("RIGHTFIRE", ale::RIGHTFIRE) + .value("LEFTFIRE", ale::LEFTFIRE) + .value("DOWNFIRE", ale::DOWNFIRE) + .value("UPRIGHTFIRE", ale::UPRIGHTFIRE) + .value("UPLEFTFIRE", ale::UPLEFTFIRE) + .value("DOWNRIGHTFIRE", ale::DOWNRIGHTFIRE) + .value("DOWNLEFTFIRE", ale::DOWNLEFTFIRE) .export_values(); py::enum_(m, "LoggerMode") diff --git a/src/ale/python/env.py b/src/ale/python/env.py index 921cd664..d5371a7e 100644 --- a/src/ale/python/env.py +++ b/src/ale/python/env.py @@ -308,7 +308,7 @@ def step( # pyright: ignore[reportIncompatibleMethodOverride] # Frameskip reward = 0.0 for _ in range(frameskip): - reward += self.ale.act(action_idx, strength, Action.PLAYER_B_NOOP, 0.0) + reward += self.ale.act(action_idx, strength, Action.NOOP, 0.0) is_terminal = self.ale.game_over(with_truncation=False) is_truncated = self.ale.game_truncated() @@ -369,24 +369,24 @@ def get_keys_to_action(self) -> dict[tuple[int, ...], ale_py.Action]: NOOP = ord("e") mapping = { - ale_py.Action.PLAYER_A_NOOP: (NOOP,), - ale_py.Action.PLAYER_A_UP: (UP,), - ale_py.Action.PLAYER_A_FIRE: (FIRE,), - ale_py.Action.PLAYER_A_DOWN: (DOWN,), - ale_py.Action.PLAYER_A_LEFT: (LEFT,), - ale_py.Action.PLAYER_A_RIGHT: (RIGHT,), - ale_py.Action.PLAYER_A_UPFIRE: (UP, FIRE), - ale_py.Action.PLAYER_A_DOWNFIRE: (DOWN, FIRE), - ale_py.Action.PLAYER_A_LEFTFIRE: (LEFT, FIRE), - ale_py.Action.PLAYER_A_RIGHTFIRE: (RIGHT, FIRE), - ale_py.Action.PLAYER_A_UPLEFT: (UP, LEFT), - ale_py.Action.PLAYER_A_UPRIGHT: (UP, RIGHT), - ale_py.Action.PLAYER_A_DOWNLEFT: (DOWN, LEFT), - ale_py.Action.PLAYER_A_DOWNRIGHT: (DOWN, RIGHT), - ale_py.Action.PLAYER_A_UPLEFTFIRE: (UP, LEFT, FIRE), - ale_py.Action.PLAYER_A_UPRIGHTFIRE: (UP, RIGHT, FIRE), - ale_py.Action.PLAYER_A_DOWNLEFTFIRE: (DOWN, LEFT, FIRE), - ale_py.Action.PLAYER_A_DOWNRIGHTFIRE: (DOWN, RIGHT, FIRE), + ale_py.Action.NOOP: (NOOP,), + ale_py.Action.UP: (UP,), + ale_py.Action.FIRE: (FIRE,), + ale_py.Action.DOWN: (DOWN,), + ale_py.Action.LEFT: (LEFT,), + ale_py.Action.RIGHT: (RIGHT,), + ale_py.Action.UPFIRE: (UP, FIRE), + ale_py.Action.DOWNFIRE: (DOWN, FIRE), + ale_py.Action.LEFTFIRE: (LEFT, FIRE), + ale_py.Action.RIGHTFIRE: (RIGHT, FIRE), + ale_py.Action.UPLEFT: (UP, LEFT), + ale_py.Action.UPRIGHT: (UP, RIGHT), + ale_py.Action.DOWNLEFT: (DOWN, LEFT), + ale_py.Action.DOWNRIGHT: (DOWN, RIGHT), + ale_py.Action.UPLEFTFIRE: (UP, LEFT, FIRE), + ale_py.Action.UPRIGHTFIRE: (UP, RIGHT, FIRE), + ale_py.Action.DOWNLEFTFIRE: (DOWN, LEFT, FIRE), + ale_py.Action.DOWNRIGHTFIRE: (DOWN, RIGHT, FIRE), } # Map @@ -404,49 +404,49 @@ def map_action_idx( """Return an action idx given unit actions for underlying env.""" # no op and fire if left_center_right == 0 and down_center_up == 0 and not fire: - return ale_py.Action.PLAYER_A_NOOP + return ale_py.Action.NOOP elif left_center_right == 0 and down_center_up == 0 and fire: - return ale_py.Action.PLAYER_A_FIRE + return ale_py.Action.FIRE # cardinal no fire elif left_center_right == -1 and down_center_up == 0 and not fire: - return ale_py.Action.PLAYER_A_LEFT + return ale_py.Action.LEFT elif left_center_right == 1 and down_center_up == 0 and not fire: - return ale_py.Action.PLAYER_A_RIGHT + return ale_py.Action.RIGHT elif left_center_right == 0 and down_center_up == -1 and not fire: - return ale_py.Action.PLAYER_A_DOWN + return ale_py.Action.DOWN elif left_center_right == 0 and down_center_up == 1 and not fire: - return ale_py.Action.PLAYER_A_UP + return ale_py.Action.UP # cardinal fire if left_center_right == -1 and down_center_up == 0 and fire: - return ale_py.Action.PLAYER_A_LEFTFIRE + return ale_py.Action.LEFTFIRE elif left_center_right == 1 and down_center_up == 0 and fire: - return ale_py.Action.PLAYER_A_RIGHTFIRE + return ale_py.Action.RIGHTFIRE elif left_center_right == 0 and down_center_up == -1 and fire: - return ale_py.Action.PLAYER_A_DOWNFIRE + return ale_py.Action.DOWNFIRE elif left_center_right == 0 and down_center_up == 1 and fire: - return ale_py.Action.PLAYER_A_UPFIRE + return ale_py.Action.UPFIRE # diagonal no fire elif left_center_right == -1 and down_center_up == -1 and not fire: - return ale_py.Action.PLAYER_A_DOWNLEFT + return ale_py.Action.DOWNLEFT elif left_center_right == 1 and down_center_up == -1 and not fire: - return ale_py.Action.PLAYER_A_DOWNRIGHT + return ale_py.Action.DOWNRIGHT elif left_center_right == -1 and down_center_up == 1 and not fire: - return ale_py.Action.PLAYER_A_UPLEFT + return ale_py.Action.UPLEFT elif left_center_right == 1 and down_center_up == 1 and not fire: - return ale_py.Action.PLAYER_A_UPRIGHT + return ale_py.Action.UPRIGHT # diagonal fire elif left_center_right == -1 and down_center_up == -1 and fire: - return ale_py.Action.PLAYER_A_DOWNLEFTFIRE + return ale_py.Action.DOWNLEFTFIRE elif left_center_right == 1 and down_center_up == -1 and fire: - return ale_py.Action.PLAYER_A_DOWNRIGHTFIRE + return ale_py.Action.DOWNRIGHTFIRE elif left_center_right == -1 and down_center_up == 1 and fire: - return ale_py.Action.PLAYER_A_UPLEFTFIRE + return ale_py.Action.UPLEFTFIRE elif left_center_right == 1 and down_center_up == 1 and fire: - return ale_py.Action.PLAYER_A_UPRIGHTFIRE + return ale_py.Action.UPRIGHTFIRE # just in case else: