changed all unique_ptr that doesn't have ownership to a const reference
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
#include "curses_output.h"
|
#include "curses_output.h"
|
||||||
|
|
||||||
curses_output::curses_output(std::unique_ptr<cursor> &new_curse):
|
curses_output::curses_output(const std::unique_ptr<cursor> &new_curse):
|
||||||
curse{new_curse} {}
|
curse{new_curse} {}
|
||||||
|
|
||||||
void curses_output::render() {
|
void curses_output::render() {
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
class curses_output final : public display {
|
class curses_output final : public display {
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<cursor> &curse;
|
const std::unique_ptr<cursor> &curse;
|
||||||
public:
|
public:
|
||||||
curses_output(std::unique_ptr<cursor> &new_curse);
|
curses_output(const std::unique_ptr<cursor> &new_curse);
|
||||||
|
|
||||||
void render() override;
|
void render() override;
|
||||||
void clear() override;
|
void clear() override;
|
||||||
|
16
src/game.h
16
src/game.h
@ -13,17 +13,17 @@
|
|||||||
class game final {
|
class game final {
|
||||||
private:
|
private:
|
||||||
feature features;
|
feature features;
|
||||||
std::unique_ptr<input> ∈
|
const std::unique_ptr<input> ∈
|
||||||
std::unique_ptr<display> &out;
|
const std::unique_ptr<display> &out;
|
||||||
std::unique_ptr<logger> &log;
|
const std::unique_ptr<logger> &log;
|
||||||
std::unique_ptr<RNG> &rng;
|
const 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,
|
const std::unique_ptr<input> &new_in,
|
||||||
std::unique_ptr<display> &new_out,
|
const std::unique_ptr<display> &new_out,
|
||||||
std::unique_ptr<logger> &new_log,
|
const std::unique_ptr<logger> &new_log,
|
||||||
std::unique_ptr<RNG> &new_rng);
|
const std::unique_ptr<RNG> &new_rng);
|
||||||
game_status run();
|
game_status run();
|
||||||
private:
|
private:
|
||||||
int getcmd() const;
|
int getcmd() const;
|
||||||
|
@ -19,7 +19,7 @@ public:
|
|||||||
void print_char(const position &pos, const char ch);
|
void print_char(const position &pos, const char ch);
|
||||||
void print_str(const position &pos, const std::string &str);
|
void print_str(const position &pos, const std::string &str);
|
||||||
void print_turn(const unsigned turn);
|
void print_turn(const unsigned turn);
|
||||||
void print_player(std::unique_ptr<character> &player);
|
void print_player(const character &player);
|
||||||
void print_chlist(const character_list &chlist);
|
void print_chlist(const character_list &chlist);
|
||||||
void print_gold(const gold_list &gold_piles);
|
void print_gold(const gold_list &gold_piles);
|
||||||
void print_potions(const potion_list &potions);
|
void print_potions(const potion_list &potions);
|
||||||
|
Reference in New Issue
Block a user