yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
gui_action_generator.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_SERVICE_GUI_GUI_ACTION_GENERATOR_H_
2#define YAZE_CLI_SERVICE_GUI_GUI_ACTION_GENERATOR_H_
3
4#include <string>
5#include <vector>
6
7#include "absl/status/statusor.h"
9
10#ifdef YAZE_WITH_JSON
11#include "nlohmann/json.hpp"
12#endif
13
14namespace yaze {
15namespace cli {
16namespace gui {
17
26 public:
27 GuiActionGenerator() = default;
28
34 absl::StatusOr<std::string> GenerateTestScript(
35 const std::vector<ai::AIAction>& actions);
36
37#ifdef YAZE_WITH_JSON
43 absl::StatusOr<nlohmann::json> GenerateTestJSON(
44 const std::vector<ai::AIAction>& actions);
45#endif
46
50 std::string ActionToTestStep(const ai::AIAction& action, int step_number);
51
52 private:
53 // Helper functions for specific action types
54 std::string GenerateOpenEditorStep(const ai::AIAction& action);
55 std::string GenerateSelectTileStep(const ai::AIAction& action);
56 std::string GeneratePlaceTileStep(const ai::AIAction& action);
57 std::string GenerateSaveTileStep(const ai::AIAction& action);
58 std::string GenerateClickButtonStep(const ai::AIAction& action);
59 std::string GenerateWaitStep(const ai::AIAction& action);
60 std::string GenerateScreenshotStep(const ai::AIAction& action);
61
62#ifdef YAZE_WITH_JSON
63 nlohmann::json ActionToJSON(const ai::AIAction& action);
64#endif
65};
66
67} // namespace gui
68} // namespace cli
69} // namespace yaze
70
71#endif // YAZE_CLI_SERVICE_GUI_GUI_ACTION_GENERATOR_H_
Converts high-level AI actions into executable GUI test scripts.
std::string GenerateSelectTileStep(const ai::AIAction &action)
std::string GenerateOpenEditorStep(const ai::AIAction &action)
std::string ActionToTestStep(const ai::AIAction &action, int step_number)
std::string GeneratePlaceTileStep(const ai::AIAction &action)
std::string GenerateClickButtonStep(const ai::AIAction &action)
absl::StatusOr< std::string > GenerateTestScript(const std::vector< ai::AIAction > &actions)
std::string GenerateSaveTileStep(const ai::AIAction &action)
std::string GenerateScreenshotStep(const ai::AIAction &action)
std::string GenerateWaitStep(const ai::AIAction &action)
Main namespace for the application.
Definition controller.cc:20
Represents a single action to be performed in the GUI.