Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
write_to_output_state.h
Go to the documentation of this file.
1#ifndef WRITE_TO_OUTPUT_STATE_H
2#define WRITE_TO_OUTPUT_STATE_H
3
6#include <MazeBuilder/state.h>
7
8#include <string>
9#include <string_view>
10
13namespace mazes
14{
15 class args;
16 class configurator;
17 class randomizer;
18 class runtime_stack;
19
25 class write_to_output_state : public state
26 {
27 public:
32
33 ~write_to_output_state() override;
34
40 bool update(randomizer &rng, double delta_time) noexcept override final;
41
42 void draw() const noexcept override;
43
44 protected:
47 [[nodiscard]] configurator make_config(const args &a) noexcept;
48
54 [[nodiscard]] virtual bool write_output(const std::string &output_target, const std::string &output_content) noexcept = 0;
55
56 args_manager *args_mapper;
57 grid_manager *grid_mapper;
58 processed_text_manager *processed_text_mapper;
59 grid_identifier current_grid_id;
60 std::string m_result;
61 };
62} // namespace mazes
63
64#endif // WRITE_TO_OUTPUT_STATE_H
Command-line argument handler with JSON support.
Definition args.h:19
Configuration class for arguments.
Definition configurator.h:21
Provides random-number generating capabilities.
Definition randomizer.h:16
Class representing the runtime stack of states in the maze builder application.
Definition runtime_stack.h:25
bool update(randomizer &rng, double delta_time) noexcept override final
Update the state with the given arguments and delta time Common logic for parsing arguments,...
configurator make_config(const args &a) noexcept
Builds the configuration for create(), sizing it to the current grid.
write_to_output_state(const runtime_app::context &ctx, runtime_stack *stack)
Construct a new write to output state.
virtual bool write_output(const std::string &output_target, const std::string &output_content) noexcept=0
Write the output to the target destination Subclasses should override this to handle format-specific ...
struct representing the context passed to states in the runtime_app stack
Definition runtime_app.h:34