Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
445e953
BDSP AutoStory sim: a grid simulation of the walker, and story rows o…
dayfine Nov 2, 2026
fd349b3
BDSP AutoStory sim: scenes from the maps' coord events
dayfine Nov 2, 2026
e6913de
Merge origin/bdsp/autostory-v4 (1b8fced9a) into bdsp/sim
dayfine Nov 2, 2026
c7617ee
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 2, 2026
5bcbef2
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 2, 2026
c32d50c
BDSP AutoStory sim: miss each fade and banner in turn (#162)
dayfine Nov 2, 2026
b13b4ed
Merge bdsp/autostory-v4 (coord events from bdsp/maps-v4) into bdsp/sim
dayfine Nov 2, 2026
5ddac89
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 2, 2026
fa75aca
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 3, 2026
d581815
BDSP AutoStory sim: run the whole table, check every row's end
dayfine Nov 3, 2026
df6b1e4
Merge bdsp/autostory-v4 (040693c62: verify mode from #122) into bdsp/sim
dayfine Nov 3, 2026
b6f2f4d
Merge commit '7f16d8cab644e842a2d30a9adf89c56da7615a33' into HEAD
dayfine Nov 5, 2026
9eb12c0
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sim
dayfine Nov 6, 2026
a9b57b2
BDSP AutoStory sim: align with PR #231 lint conventions
dayfine Nov 6, 2026
f453d2a
BDSP AutoStory sim: initialize all designated fields for Windows Clang
dayfine Nov 6, 2026
934c537
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sim
dayfine Nov 7, 2026
756354d
BDSP AutoStory: move GridSim and simulation tests into Simulation/ su…
dayfine Nov 7, 2026
c29ca3e
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sim
dayfine Nov 7, 2026
f54688c
Merge origin/bdsp/autostory-v4 into bdsp/sim
dayfine Nov 8, 2026
2e2fcb3
BDSP AutoStory sim: bound door runs by tile distance and support whit…
dayfine Nov 8, 2026
20259ee
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sim
dayfine Nov 8, 2026
67438e5
BDSP AutoStory sim: add recovery walk and interrupted mine tap tests …
dayfine Nov 8, 2026
22768f1
Fix tiles_to_door map lookup in StoryWalkSteps
dayfine Nov 8, 2026
9a1bd0c
BDSP AutoStory sim: align RecoveryWalk test start position to north o…
dayfine Nov 8, 2026
a8924e8
BDSP AutoStory sim: declare recover_tapped_leg in StoryWalkSteps.h
dayfine Nov 8, 2026
2b960ab
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sim
dayfine Nov 8, 2026
d7599ac
Merge origin/bdsp/autostory-v4 into bdsp/sim
dayfine Nov 8, 2026
81c2ee2
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into HEAD
dayfine Nov 9, 2026
a15beee
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
659ab71
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
8dd169c
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
58b06b7
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
5542c5c
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
d23bd12
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
79bb4d1
BDSP AutoStory sim: build #167 on its own
dayfine Nov 9, 2026
7102b94
BDSP AutoStory sim: the recovery walk test builds its own mine step
dayfine Nov 9, 2026
77a11d8
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
7f0e6e6
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
a0afc1a
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
135bd4f
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
387f6d4
Merge bdsp/autostory-v4 (merge of #122 b3aa69e19) into bdsp/sim
dayfine Nov 9, 2026
b4c698b
Merge bdsp/walk-v4 (timed walk events, open-leg battle placement) int…
dayfine Nov 9, 2026
5438fa3
Merge bdsp/walk-v4 into bdsp/sim
dayfine Nov 9, 2026
cd85c94
BDSP sim: record a tap battle's screen events as the console's walk does
dayfine Nov 9, 2026
83f9ce2
Merge bdsp/walk-v4 (open-leg battles placed by screen events) into bd…
dayfine Nov 9, 2026
7885ffa
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
48bbe8d
BDSP AutoStory sim: a leg that ends on another map ends at an unknown…
dayfine Nov 9, 2026
c6d5396
Merge bdsp/autostory-v4 into bdsp/sim
dayfine Nov 9, 2026
ca6df14
Merge bdsp/autostory-v4 into bdsp/sim (wait for a battle's opening be…
dayfine Nov 9, 2026
09a3302
Merge bdsp/autostory-v4 into bdsp/sim (scene ends after its fade; scr…
dayfine Nov 9, 2026
c8ca11d
Merge bdsp/autostory-v4 into bdsp/sim: a step on the Switch HOME menu…
dayfine Nov 9, 2026
fe89194
Merge origin/bdsp/autostory-v4 into bdsp/sim
dayfine Nov 10, 2026
57bd4a1
Merge branch 'bdsp/autostory-v4' into bdsp/sim: migrate story steps t…
dayfine Nov 10, 2026
11ddf44
Merge branch 'bdsp/autostory-v4' into bdsp/sim
dayfine Nov 10, 2026
66135e7
Merge origin/bdsp/autostory-v4 into bdsp/sim
dayfine Nov 11, 2026
0213c2b
Merge origin/bdsp/autostory-v4 into bdsp/sim
dayfine Nov 11, 2026
e5a29fa
Merge origin/bdsp/autostory-v4 (#128) into bdsp/sim
dayfine Nov 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion SerialPrograms/Source/PokemonBDSP/PokemonBDSP_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
#include "Inference/PokemonBDSP_DialogDetector.h"
#include "Inference/PokemonBDSP_MenuDetector.h"
#include "Programs/AutoStory/Actions/PokemonBDSP_AutoStory_Actions_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_GridSim_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Maps_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_PlannedRoute_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_RoutePlanner_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Segment00_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryMaps_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryWorld_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StorySimulation_Tests.h"
#include "Programs/AutoStory/Simulation/PokemonBDSP_AutoStory_StorySimulation_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryTable_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryData_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Walk_Tests.h"
Expand All @@ -40,6 +42,8 @@ void add_tests(UnitTestDatabase& database){
add_tests_AutoStory_StoryData(database);
add_tests_AutoStory_Walk(database);
add_tests_AutoStory_PlannedRoute(database);
add_tests_AutoStory_GridSim(database);
add_tests_AutoStory_RecoveryWalk(database);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/* BDSP AutoStory - Coord events
*
* From: https://github.com/PokemonAutomation/
*
*/

#include <format>
#include <map>
#include "Common/Cpp/Exceptions.h"
#include "Common/Cpp/Json/JsonArray.h"
#include "Common/Cpp/Json/JsonObject.h"
#include "Common/Cpp/Json/JsonValue.h"
#include "PokemonBDSP_AutoStory_Maps.h"
#include "PokemonBDSP_AutoStory_CoordEvents.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{

using Pokemon::TilePos;


namespace{

int read_int(const JsonObject& object, const std::string& key, const std::string& where){
const JsonValue* value = object.get_value(key);
if (value == nullptr || !value->is_integer()){
throw ParseException(where + key + " is missing or not an integer.");

Check warning on line 28 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_CoordEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
return (int)value->to_integer_default();
}

std::string read_string(const JsonObject& object, const std::string& key, const std::string& where){
const JsonValue* value = object.get_value(key);
const std::string* text = value == nullptr ? nullptr : value->to_string();
if (text == nullptr){
throw ParseException(where + key + " is missing or not a string.");

Check warning on line 37 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_CoordEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
return *text;
}

CoordEvent read_event(const JsonObject& object, const std::string& where){
CoordEvent event{
.name = read_string(object, "name", where),
.tiles = {},
.var = read_string(object, "var", where),
.value = read_int(object, "value", where),
.source = read_string(object, "source", where),
};
const int x = read_int(object, "x", where);
const int y = read_int(object, "y", where);
const int width = read_int(object, "width", where);
const int length = read_int(object, "length", where);
if (width < 1 || length < 1){
throw ParseException(where + "width and length must be at least 1.");

Check warning on line 55 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_CoordEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
for (int row = y; row < y + length; row++){
for (int col = x; col < x + width; col++){
event.tiles.push_back({col, row});
}
}
return event;
}

std::vector<CoordEvent> read_events(const std::string& name, const std::string& json){
std::vector<CoordEvent> events;
const JsonValue root = parse_json(json);
const JsonObject* object = root.to_object();
const JsonValue* list = object == nullptr ? nullptr : object->get_value("coord_events");
if (list == nullptr){
return events;
}
const JsonArray* array = list->to_array();
if (array == nullptr){
throw ParseException(name + ".json: coord_events is not an array.");

Check warning on line 75 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_CoordEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
for (size_t c = 0; c < array->size(); c++){
const std::string where = std::format("{}.json: coord_events[{}].", name, c);
const JsonObject* item = (*array)[c].to_object();
if (item == nullptr){
throw ParseException(where + " is not an object.");

Check warning on line 81 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_CoordEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
events.push_back(read_event(*item, where));
}
return events;
}

} // namespace


const std::vector<CoordEvent>& story_coord_events(std::string_view map){
static const std::map<std::string, std::vector<CoordEvent>, std::less<>> by_map = []{
std::map<std::string, std::vector<CoordEvent>, std::less<>> out;
for (const auto& [name, json] : bdsp_map_json()){
out.emplace(name, read_events(name, json));
}
return out;
}();
if (auto iter = by_map.find(map); iter != by_map.end()){
return iter->second;
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No BDSP story map named \"{}\".", map));
}



} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* BDSP AutoStory - Coord events
*
* From: https://github.com/PokemonAutomation/
*
* The scene triggers of the story maps: stepping onto one of an event's
* tiles while its story variable holds `value` starts its script. They are
* the decomp's coord events (zone_event), read from a map's
* "coord_events", which the shared map schema leaves to the game:
*
* "coord_events": [{"name": "catch_tutorial", "x": 21, "y": 25, "width": 1, "length": 5,
* "var": "VAR_ROUTE_202_STATE", "value": 0, "source": "..."}, ...]
*
* A trigger seen on the console that the decomp does not have names the run
* in `source`.
*
*/

#ifndef PokemonAutomation_PokemonBDSP_AutoStory_CoordEvents_H
#define PokemonAutomation_PokemonBDSP_AutoStory_CoordEvents_H

#include <string>
#include <string_view>
#include <vector>
#include "Pokemon/Navigation/Pokemon_Grid.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{


// Coordinate-triggered event parsed from BDSP map data.
struct CoordEvent{
std::string name;
// The map's own tiles: `width` columns from x, `length` rows from y.
std::vector<Pokemon::TilePos> tiles;
std::string var;
int value = 0;
std::string source;
};

// The coord events of the map `map` (a JSON map's name), none if it lists
// none. Throws InternalProgramError for an unknown map, and ParseException
// for an event that does not parse.
const std::vector<CoordEvent>& story_coord_events(std::string_view map);



} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/* BDSP Recovery Walk Tests
*
* From: https://github.com/PokemonAutomation/
*
* November 5 mine report: EAST 14 moved 4 beside Machop on row 15.
* The exact deployed revision/run ID is unavailable. BEFORE/AFTER events
* and two interrupted advances are explicit diagnostics, not an inferred
* physical cause. Run the real story step and route walker on GridSim.
*/
#include <algorithm>
#include "Pokemon/AutoStory/Pokemon_TilePose.h"
#include "Pokemon/AutoStory/Types/Pokemon_StoryActionArg.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_WalkResult.h"
#include "Simulation/PokemonBDSP_AutoStory_GridSim.h"
#include "PokemonBDSP_AutoStory_StoryPlaces.h"
#include "PokemonBDSP_AutoStory_StoryStepIO.h"
#include "PokemonBDSP_AutoStory_StoryTable.h"
#include "PokemonBDSP_AutoStory_StoryWalkSteps.h"
#include "PokemonBDSP_AutoStory_RecoveryWalk_Tests.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{
namespace{
using namespace std::chrono_literals;
using Pokemon::Direction;
using Pokemon::TilePos;

class InterruptingRouteIO : public GridSimRouteIO{
public:
InterruptingRouteIO(GridSim& sim, std::vector<std::string>& notes,
std::vector<SimWildTap> taps, size_t interrupted_holds)
: GridSimRouteIO(sim, notes, std::move(taps)), m_left(interrupted_holds)
{}
virtual WalkResult walk_to_wall(const RouteWallWalk& walk) override{
if (m_left > 0){
m_left--;
return {.stop = WalkStop::LIMIT, .walked = 400ms, .wild_battles = 1};
}
return GridSimRouteIO::walk_to_wall(walk);
}
private:
size_t m_left;
};

// Only walking is needed for this real LEGS step. Unexpected story actions
// fail the test. The actual RouteWalker executes through the GridSim RouteIO.
class RecoveryStepIO : public StoryStepIO{

Check warning on line 48 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonBDSP::RecoveryStepIO: public_methods=7 (advisory above 5, limit 7)
public:
explicit RecoveryStepIO(RouteIO& route) : m_route(route){}
virtual RouteIO& route() override{ return m_route; }
virtual void fight(const std::string&) override{ throw GridSimFailure{"unexpected trainer"}; }
virtual void walk_until_stopped(Direction, size_t, const std::string&) override{ throw GridSimFailure{"unexpected blind hold"}; }
virtual bool run_until_map(Direction, Milliseconds, const std::string&, const std::string&) override{ throw GridSimFailure{"unexpected banner walk"}; }
virtual bool run_into_door(Direction, bool, Milliseconds = Milliseconds(12000)) override{ throw GridSimFailure{"unexpected door"}; }
virtual std::optional<size_t> tap_to_banner(Direction, const std::string&, size_t) override{ throw GridSimFailure{"unexpected banner"}; }
virtual void settle(Button, const std::string&, bool) override{ throw GridSimFailure{"unexpected scene"}; }
private:
RouteIO& m_route;
};

const Pokemon::StoryStep& mine_step(){
static const Pokemon::StoryStep step = []{
Pokemon::StoryStep step;
step.kind = Pokemon::StoryStepKind::LEGS;
step.name = "below_roark";
step.action = "open";
step.args["legs"] = std::vector<Pokemon::StoryLeg>{
{.direction = Direction::EAST, .tiles = 1},
{.direction = Direction::SOUTH, .tiles = 2},
{.direction = Direction::WEST, .tiles = 1},
{.direction = Direction::SOUTH, .tiles = 5},
{.direction = Direction::EAST, .tiles = 14},
{.direction = Direction::SOUTH, .tiles = 10},
{.direction = Direction::WEST, .tiles = 2},
{.direction = Direction::SOUTH, .tiles = 3},
{.direction = Direction::WEST, .tiles = 9},
};
return step;
}();
return step;
}

struct RecoveryInput{
std::string name;
std::vector<size_t> taps;
Direction direction = Direction::SOUTH;
size_t tiles = 5;
SimEncounterPhase phase = SimEncounterPhase::BEFORE_MOVEMENT;
WalkOrigin origin = WalkOrigin::CURRENT_LEG;
size_t interrupted_holds = 0;
};
struct RecoveryExpectation{
std::string failure = {};
TilePos end = {.x = 18, .y = 29};
Direction facing = Direction::WEST;
};
struct RecoveryCase{
RecoveryInput input;
RecoveryExpectation expectation;
};

class Test_RecoveryWalk : public UnitTest{
public:
explicit Test_RecoveryWalk(RecoveryCase data)
: UnitTest("PokemonBDSP::AutoStory - Recovery walk: " + data.input.name), m_case(std::move(data))

Check warning on line 106 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
{}
virtual UnitTestResult run(Logger&, CancellableScope&) const override{

Check warning on line 108 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonBDSP::Test_RecoveryWalk::run( Logger & , CancellableScope &) const: function_lines=37 (advisory above 25, limit 50)
const StoryWorld* world = story_plan_world("OreburghMine", "OreburghMine");
if (world == nullptr){
return "Missing native mine world.";
}
GridSim sim({.world = world}, world->to_world("OreburghMine", {15, 9}), Direction::SOUTH, true);
std::vector<SimWildTap> taps;
for (size_t tap : m_case.input.taps){
taps.push_back({.label = "below_roark", .direction = m_case.input.direction,
.requested_tiles = m_case.input.tiles, .tap = tap, .phase = m_case.input.phase, .origin = m_case.input.origin});
}
std::vector<std::string> notes;
InterruptingRouteIO route(sim, notes, std::move(taps), m_case.input.interrupted_holds);
RecoveryStepIO io(route);
StoryWalkSteps walks(io);
walks.begin_attempt("01.03");
Pokemon::RunState state{.pose = Pokemon::tile_pose("OreburghMine", {{15, 9}}, Direction::SOUTH), .flags = {}};
std::string failure;
std::optional<Pokemon::Pose> declared;
try{
const auto outcome = walks.legs(state, mine_step());
failure = outcome.failure;
declared = outcome.pose;
}catch (const GridSimFailure& error){
failure = error.message;
}
if (!m_case.expectation.failure.empty()){
return failure.find(m_case.expectation.failure) != std::string::npos ? UnitTestResult(true)
: UnitTestResult("Expected " + m_case.expectation.failure + ", got " + failure);

Check warning on line 136 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
const auto end = story_to_local(*world, "OreburghMine", nearest_tile(sim.player().pos));
if (!failure.empty() || !end || *end != m_case.expectation.end || !declared
|| Pokemon::facing_of(*declared) != sim.player().facing || sim.player().facing != m_case.expectation.facing){
return "Expected below Roark (18,29), got " + to_string(sim.player().pos) + ": " + failure;

Check warning on line 141 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_RecoveryWalk_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
return true;
}
private:
RecoveryCase m_case;
};
} // namespace

void add_tests_AutoStory_RecoveryWalk(UnitTestDatabase& database){
const RecoveryCase CASES[] = {
{.input = {.name = "uninterrupted native mine step", .taps = {}}, .expectation = {.failure = ""}},
{.input = {.name = "last tap interrupted before movement", .taps = {5}}, .expectation = {.failure = ""}},
{.input = {.name = "last tap completed before battle", .taps = {5}, .phase = SimEncounterPhase::AFTER_MOVEMENT}, .expectation = {.failure = ""}},
{.input = {.name = "two interrupted advances, row 15", .taps = {4, 5}}, .expectation = {.failure = ""}},
{.input = {.name = "last west leg recovers position and facing", .taps = {9}, .direction = Direction::WEST, .tiles = 9}, .expectation = {.failure = ""}},
{.input = {.name = "repeat the interrupted recovery hold", .taps = {5}, .interrupted_holds = 1}, .expectation = {.failure = ""}},
{.input = {.name = "recovery hold budget exhausted", .taps = {5}, .interrupted_holds = 10}, .expectation = {.failure = "recovery budget"}},
{.input = {.name = "first input may belong to previous leg", .taps = {1}}, .expectation = {.failure = "encounter_origin_unknown"}},
{.input = {.name = "late encounter origin unknown", .taps = {5}, .origin = WalkOrigin::MAY_PRECEDE_LEG}, .expectation = {.failure = "encounter_origin_unknown"}},
};
for (const RecoveryCase& scenario : CASES){
database.add<Test_RecoveryWalk>(scenario);
}
}
} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* BDSP Recovery Walk Tests
* From: https://github.com/PokemonAutomation/
*/
#ifndef PokemonAutomation_PokemonBDSP_AutoStory_RecoveryWalk_Tests_H
#define PokemonAutomation_PokemonBDSP_AutoStory_RecoveryWalk_Tests_H
#include "Common/Cpp/TestRunners/UnitTestDatabase.h"
namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{
// Register mine interruption, localization and bounded recovery scenarios.
void add_tests_AutoStory_RecoveryWalk(UnitTestDatabase& database);
} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Loading
Loading