Add Overworld accessors and enhance testing framework
- Introduced new methods in `Controller`, `EditorManager`, and `OverworldEditor` to access the `Overworld` instance, improving modularity and interaction with the overworld data. - Added `GetTile` method in `Overworld` to retrieve tile data based on coordinates, enhancing functionality for tile manipulation. - Implemented a new testing framework with automated GUI tests, including `CanvasSelectionTest` and `FrameworkSmokeTest`, to validate user interactions and ensure robustness. - Updated `CMakeLists.txt` to include new test files and dependencies, streamlining the build process for testing. - Refactored logging behavior to ensure proper file handling during logging operations, improving reliability in logging outputs.
This commit is contained in:
@@ -278,6 +278,15 @@ class Overworld {
|
||||
auto expanded_entrances() const { return expanded_entrances_; }
|
||||
void set_current_map(int i) { current_map_ = i; }
|
||||
void set_current_world(int world) { current_world_ = world; }
|
||||
uint16_t GetTile(int x, int y) const {
|
||||
if (current_world_ == 0) {
|
||||
return map_tiles_.light_world[y][x];
|
||||
} else if (current_world_ == 1) {
|
||||
return map_tiles_.dark_world[y][x];
|
||||
} else {
|
||||
return map_tiles_.special_world[y][x];
|
||||
}
|
||||
}
|
||||
auto map_tiles() const { return map_tiles_; }
|
||||
auto mutable_map_tiles() { return &map_tiles_; }
|
||||
auto all_items() const { return all_items_; }
|
||||
|
||||
Reference in New Issue
Block a user