commit fb0e31af
Switch to initilizer lists
Changed files
| M | src/MenuSystem.cpp before |
diff --git a/src/MenuSystem.cpp b/src/MenuSystem.cpp
index 54f5666..0f49c97 100644
--- a/src/MenuSystem.cpp
+++ b/src/MenuSystem.cpp
@@ -63,10 +63,7 @@ Button::Button() {
Button::~Button() {
}
-Button::Button(const Button& b) {
- label = b.label;
- marked = b.marked;
- action = b.action;
+Button::Button(const Button& b) : action{b.action}, label{b.label}, marked{b.marked} {
}
void Button::setLabel(const std::string& text) {
@@ -160,10 +157,9 @@ Menu::Menu(SDL_Renderer* screen,bool submenu) {
}
}
-Menu::Menu(SDL_Renderer* screen, const std::string& title, bool submenu) {
+Menu::Menu(SDL_Renderer* screen, const std::string& title, bool submenu) : title{title} {
this->screen = screen;
isSubmenu = submenu;
- this->title = title;
if (isSubmenu) {
exit.setLabel(_("Back") );
}