mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 19:10:48 +00:00
remove game_classification::completion member
this member was never read just written
This commit is contained in:
parent
9285ea89c8
commit
641d59e4bc
@ -39,7 +39,6 @@ game_classification::game_classification():
|
|||||||
mod_defines(),
|
mod_defines(),
|
||||||
campaign(),
|
campaign(),
|
||||||
abbrev(),
|
abbrev(),
|
||||||
completion(),
|
|
||||||
end_credits(true),
|
end_credits(true),
|
||||||
end_text(),
|
end_text(),
|
||||||
end_text_duration(),
|
end_text_duration(),
|
||||||
@ -60,7 +59,6 @@ game_classification::game_classification(const config& cfg):
|
|||||||
mod_defines(utils::split(cfg["mod_defines"])),
|
mod_defines(utils::split(cfg["mod_defines"])),
|
||||||
campaign(cfg["campaign"]),
|
campaign(cfg["campaign"]),
|
||||||
abbrev(cfg["abbrev"]),
|
abbrev(cfg["abbrev"]),
|
||||||
completion(cfg["completion"]),
|
|
||||||
end_credits(cfg["end_credits"].to_bool(true)),
|
end_credits(cfg["end_credits"].to_bool(true)),
|
||||||
end_text(cfg["end_text"]),
|
end_text(cfg["end_text"]),
|
||||||
end_text_duration(cfg["end_text_duration"]),
|
end_text_duration(cfg["end_text_duration"]),
|
||||||
@ -81,7 +79,6 @@ game_classification::game_classification(const game_classification& gc):
|
|||||||
mod_defines(gc.mod_defines),
|
mod_defines(gc.mod_defines),
|
||||||
campaign(gc.campaign),
|
campaign(gc.campaign),
|
||||||
abbrev(gc.abbrev),
|
abbrev(gc.abbrev),
|
||||||
completion(gc.completion),
|
|
||||||
end_credits(gc.end_credits),
|
end_credits(gc.end_credits),
|
||||||
end_text(gc.end_text),
|
end_text(gc.end_text),
|
||||||
end_text_duration(gc.end_text_duration),
|
end_text_duration(gc.end_text_duration),
|
||||||
@ -105,7 +102,6 @@ config game_classification::to_config() const
|
|||||||
cfg["mod_defines"] = utils::join(mod_defines);
|
cfg["mod_defines"] = utils::join(mod_defines);
|
||||||
cfg["campaign"] = campaign;
|
cfg["campaign"] = campaign;
|
||||||
cfg["abbrev"] = abbrev;
|
cfg["abbrev"] = abbrev;
|
||||||
cfg["completion"] = completion;
|
|
||||||
cfg["end_credits"] = end_credits;
|
cfg["end_credits"] = end_credits;
|
||||||
cfg["end_text"] = end_text;
|
cfg["end_text"] = end_text;
|
||||||
cfg["end_text_duration"] = str_cast<unsigned int>(end_text_duration);
|
cfg["end_text_duration"] = str_cast<unsigned int>(end_text_duration);
|
||||||
|
@ -50,8 +50,6 @@ public:
|
|||||||
std::string campaign; /**< the campaign being played */
|
std::string campaign; /**< the campaign being played */
|
||||||
|
|
||||||
std::string abbrev; /**< the campaign abbreviation */
|
std::string abbrev; /**< the campaign abbreviation */
|
||||||
// std::string scenario; /**< the scenario being played */
|
|
||||||
std::string completion; /**< running. victory, or defeat */
|
|
||||||
bool end_credits; /**< whether to show the standard credits at the end */
|
bool end_credits; /**< whether to show the standard credits at the end */
|
||||||
std::string end_text; /**< end-of-campaign text */
|
std::string end_text; /**< end-of-campaign text */
|
||||||
unsigned int end_text_duration; /**< for how long the end-of-campaign text is shown */
|
unsigned int end_text_duration; /**< for how long the end-of-campaign text is shown */
|
||||||
|
@ -262,10 +262,6 @@ void playmp_controller::linger()
|
|||||||
// If we need to set the status depending on the completion state
|
// If we need to set the status depending on the completion state
|
||||||
// we're needed here.
|
// we're needed here.
|
||||||
gui_->set_game_mode(game_display::LINGER_MP);
|
gui_->set_game_mode(game_display::LINGER_MP);
|
||||||
|
|
||||||
// this is actually for after linger mode is over -- we don't want to
|
|
||||||
// stay stuck in linger state when the *next* scenario is over.
|
|
||||||
set_completion setter(saved_game_,"running");
|
|
||||||
// End all unit moves
|
// End all unit moves
|
||||||
gamestate_.board_.set_all_units_user_end_turn();
|
gamestate_.board_.set_all_units_user_end_turn();
|
||||||
|
|
||||||
|
@ -397,7 +397,6 @@ LEVEL_RESULT playsingle_controller::play_scenario(
|
|||||||
}
|
}
|
||||||
return VICTORY;
|
return VICTORY;
|
||||||
}
|
}
|
||||||
saved_game_.classification().completion = is_victory ? "victory" : "defeat";
|
|
||||||
if(is_observer()) {
|
if(is_observer()) {
|
||||||
gui2::show_transient_message(gui_->video(), _("Game Over"), _("The game is over."));
|
gui2::show_transient_message(gui_->video(), _("Game Over"), _("The game is over."));
|
||||||
return OBSERVER_END;
|
return OBSERVER_END;
|
||||||
@ -409,12 +408,11 @@ LEVEL_RESULT playsingle_controller::play_scenario(
|
|||||||
config& info = cfg.add_child("info");
|
config& info = cfg.add_child("info");
|
||||||
info["type"] = "termination";
|
info["type"] = "termination";
|
||||||
info["condition"] = "game over";
|
info["condition"] = "game over";
|
||||||
info["result"] = saved_game_.classification().completion;
|
info["result"] = is_victory ? "victory" : "defeat";
|
||||||
network::send_data(cfg, 0);
|
network::send_data(cfg, 0);
|
||||||
}
|
}
|
||||||
if (!is_victory)
|
if (!is_victory)
|
||||||
{
|
{
|
||||||
saved_game_.classification().completion = "defeat";
|
|
||||||
pump().fire("defeat");
|
pump().fire("defeat");
|
||||||
|
|
||||||
const std::string& defeat_music = select_defeat_music();
|
const std::string& defeat_music = select_defeat_music();
|
||||||
@ -425,7 +423,6 @@ LEVEL_RESULT playsingle_controller::play_scenario(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saved_game_.classification().completion = !end_level.transient.linger_mode ? "running" : "victory";
|
|
||||||
pump().fire("victory");
|
pump().fire("victory");
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -723,11 +720,6 @@ void playsingle_controller::linger()
|
|||||||
// the key to it is here.
|
// the key to it is here.
|
||||||
gui_->set_game_mode(game_display::LINGER_SP);
|
gui_->set_game_mode(game_display::LINGER_SP);
|
||||||
|
|
||||||
// this is actually for after linger mode is over -- we don't
|
|
||||||
// want to stay stuck in linger state when the *next* scenario
|
|
||||||
// is over.
|
|
||||||
set_completion setter(saved_game_,"running");
|
|
||||||
|
|
||||||
// change the end-turn button text to its alternate label
|
// change the end-turn button text to its alternate label
|
||||||
gui_->get_theme().refresh_title2("button-endturn", "title2");
|
gui_->get_theme().refresh_title2("button-endturn", "title2");
|
||||||
gui_->invalidate_theme();
|
gui_->invalidate_theme();
|
||||||
|
@ -25,21 +25,6 @@
|
|||||||
#include "saved_game.hpp"
|
#include "saved_game.hpp"
|
||||||
class team;
|
class team;
|
||||||
|
|
||||||
struct set_completion
|
|
||||||
{
|
|
||||||
set_completion(saved_game& state, const std::string& completion) :
|
|
||||||
state_(state), completion_(completion)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~set_completion()
|
|
||||||
{
|
|
||||||
state_.classification().completion = completion_;
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
saved_game& state_;
|
|
||||||
const std::string completion_;
|
|
||||||
};
|
|
||||||
|
|
||||||
class playsingle_controller : public play_controller
|
class playsingle_controller : public play_controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user