git repos / saland

commit fb0e31af

sago007 · 2018-10-28 16:43
fb0e31af195870d2e62e1bb457c6943479644b51 patch · browse files
parent 27bca292a3049ee0abd22693b52f3ef5243b239e

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") );
}