started working on map and potions

This commit is contained in:
2024-07-09 23:27:49 -04:00
parent 9c582805a4
commit 6f0573dff8
2 changed files with 7 additions and 6 deletions

View File

@ -12,17 +12,18 @@
class game final { class game final {
private: private:
feature features;
std::unique_ptr<input> &in; std::unique_ptr<input> &in;
std::unique_ptr<display> &out; std::unique_ptr<display> &out;
std::unique_ptr<logger> &log; std::unique_ptr<logger> &log;
feature features; std::unique_ptr<RNG> &rng;
std::unique_ptr<RNG> rng;
std::unique_ptr<character> player; std::unique_ptr<character> player;
public: public:
game(const feature enabled_features, game(const feature enabled_features,
std::unique_ptr<input> &new_in, std::unique_ptr<input> &new_in,
std::unique_ptr<display> &new_out, std::unique_ptr<display> &new_out,
std::unique_ptr<logger> &new_log); std::unique_ptr<logger> &new_log,
std::unique_ptr<RNG> &new_rng);
game_status run(); game_status run();
private: private:
int getcmd() const; int getcmd() const;

View File

@ -9,17 +9,17 @@ int main(int argc, char **argv) {
std::unique_ptr<RNG> rng; std::unique_ptr<RNG> rng;
feature enabled_features = proc_args(argc, argv, feature enabled_features = proc_args(argc, argv,
curse, in, out, log, rng); curse, in, out, log, rng);
if (enabled_features & if (enabled_features &
(FEATURE_PANIC | FEATURE_PANIC_FILE | (FEATURE_PANIC | FEATURE_PANIC_FILE |
FEATURE_CONFLICT | FEATURE_PANIC_SEED)) { FEATURE_CONFLICT | FEATURE_PANIC_SEED)) {
panic_args(enabled_features); panic_args(enabled_features);
return RETURN_PANICKED; return RETURN_PANICKED;
} }
game game_proc(enabled_features, in, out, log); game game_proc(enabled_features, in, out, log, rng);
while (game_proc.run() != game_status::terminated) while (game_proc.run() != game_status::terminated)
out->render(); out->render();