mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 22:21:36 +00:00
Remove read_extra() and put the stuff directly in the constructor,
...where it belongs.
This commit is contained in:
parent
22ed92107d
commit
15a465b9db
@ -243,7 +243,8 @@ tbutton_definition::tbutton_definition(const config& cfg) :
|
||||
load_resolutions<tresolution>(cfg.get_children("resolution"));
|
||||
}
|
||||
|
||||
void tbutton_definition::tresolution::read_extra(const config& cfg)
|
||||
tbutton_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* [button_definition][resolution]
|
||||
@ -362,7 +363,8 @@ tresolution_definition_::tresolution_definition_(const config& cfg) :
|
||||
<< window_width << ", " << window_height << '\n';
|
||||
}
|
||||
|
||||
void tlabel_definition::tresolution::read_extra(const config& cfg)
|
||||
tlabel_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* [label_definition][resolution]
|
||||
@ -389,7 +391,8 @@ ttext_box_definition::ttext_box_definition(const config& cfg) :
|
||||
load_resolutions<tresolution>(cfg.get_children("resolution"));
|
||||
}
|
||||
|
||||
void ttext_box_definition::tresolution::read_extra(const config& cfg)
|
||||
ttext_box_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* [label_definition][resolution]
|
||||
@ -419,7 +422,8 @@ ttooltip_definition::ttooltip_definition(const config& cfg) :
|
||||
load_resolutions<tresolution>(cfg.get_children("resolution"));
|
||||
}
|
||||
|
||||
void ttooltip_definition::tresolution::read_extra(const config& cfg)
|
||||
ttooltip_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* [label_definition][resolution]
|
||||
|
@ -81,11 +81,6 @@ public:
|
||||
int text_font_style;
|
||||
|
||||
std::vector<tstate_definition> state;
|
||||
|
||||
private:
|
||||
//! All inherited classes need to override this and call it from
|
||||
//! their constructor. This is needed to read the extra needed fields.
|
||||
virtual void read_extra(const config& cfg) = 0;
|
||||
};
|
||||
|
||||
struct tcontrol_definition : public reference_counted_object
|
||||
@ -112,12 +107,7 @@ struct tbutton_definition : public tcontrol_definition
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{ read_extra(cfg); }
|
||||
|
||||
private:
|
||||
void read_extra(const config& cfg);
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
|
||||
};
|
||||
@ -129,12 +119,7 @@ struct tlabel_definition : public tcontrol_definition
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{ read_extra(cfg); }
|
||||
|
||||
private:
|
||||
void read_extra(const config& cfg);
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
@ -145,12 +130,7 @@ struct ttext_box_definition : public tcontrol_definition
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{ read_extra(cfg); }
|
||||
|
||||
private:
|
||||
void read_extra(const config& cfg);
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
|
||||
};
|
||||
@ -161,12 +141,7 @@ struct ttooltip_definition : public tcontrol_definition
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{ read_extra(cfg); }
|
||||
|
||||
private:
|
||||
void read_extra(const config& cfg);
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user