diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.cpp b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.cpp new file mode 100644 index 0000000000..0663f79588 --- /dev/null +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.cpp @@ -0,0 +1,30 @@ +/* Direction + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "Pokemon_Direction.h" + +namespace PokemonAutomation{ +namespace Pokemon{ + + +std::string direction_name(Direction direction){ + switch (direction){ + case Direction::NORTH: + return "north"; + case Direction::EAST: + return "east"; + case Direction::SOUTH: + return "south"; + case Direction::WEST: + return "west"; + } + return "?"; +} + + + +} // namespace Pokemon +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.h new file mode 100644 index 0000000000..5024b3ec69 --- /dev/null +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Direction.h @@ -0,0 +1,36 @@ +/* Direction + * + * From: https://github.com/PokemonAutomation/ + * + * The four cardinal directions the player can face or move in. + * + */ + +#ifndef PokemonAutomation_Pokemon_Direction_H +#define PokemonAutomation_Pokemon_Direction_H + +#include + +namespace PokemonAutomation{ +namespace Pokemon{ + + +// Row 0 is the top of a map, so SOUTH increases y. +enum class Direction{ + NORTH, + EAST, + SOUTH, + WEST, +}; +// Array containing all four cardinal directions. +constexpr Direction ALL_DIRECTIONS[] = { + Direction::NORTH, Direction::EAST, Direction::SOUTH, Direction::WEST, +}; +// Returns the lowercase name string of a cardinal direction. +std::string direction_name(Direction direction); + + + +} // namespace Pokemon +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.cpp b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.cpp index 62ec864f74..84fa47bcb1 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.cpp +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.cpp @@ -11,21 +11,6 @@ namespace PokemonAutomation{ namespace Pokemon{ -std::string direction_name(Direction direction){ - switch (direction){ - case Direction::NORTH: - return "north"; - case Direction::EAST: - return "east"; - case Direction::SOUTH: - return "south"; - case Direction::WEST: - return "west"; - } - return "?"; -} - - TilePos TilePos::next(Direction direction) const{ switch (direction){ case Direction::NORTH: diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.h index f0b1af8313..29952d347e 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.h +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_Grid.h @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Tiles and directions on an overworld grid, shared by the games that + * Tiles on an overworld grid, shared by the games that * move the player a tile at a time. * */ @@ -14,26 +14,12 @@ #include #include #include +#include "Pokemon_Direction.h" namespace PokemonAutomation{ namespace Pokemon{ -// Row 0 is the top of a map, so SOUTH increases y. -enum class Direction{ - NORTH, - EAST, - SOUTH, - WEST, -}; -// Array containing all four cardinal directions. -constexpr Direction ALL_DIRECTIONS[] = { - Direction::NORTH, Direction::EAST, Direction::SOUTH, Direction::WEST, -}; -// Returns the lowercase name string of a cardinal direction. -std::string direction_name(Direction direction); - - // Grid coordinate with integer x and y components. struct TilePos{ int x = 0; diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index e3573ae182..f48941b9b2 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1458,6 +1458,8 @@ file(GLOB LIBRARY_SOURCES Source/Pokemon/Inference/Pokemon_TrainPokemonOCR.h Source/Pokemon/Inference/Pokemon_TypeReader.cpp Source/Pokemon/Inference/Pokemon_TypeReader.h + Source/Pokemon/Navigation/Pokemon_Direction.cpp + Source/Pokemon/Navigation/Pokemon_Direction.h Source/Pokemon/Navigation/Pokemon_Grid.cpp Source/Pokemon/Navigation/Pokemon_Grid.h Source/Pokemon/Options/Pokemon_BoxSortingTable.cpp