Renamed wmi_container to wmi_manager
Since it's not a container anymore, it shouldn't be called such.
This commit is contained in:
parent
08cdfba96b
commit
1ea8e0f05c
11 changed files with 37 additions and 37 deletions
|
@ -411,8 +411,8 @@
|
|||
<Unit filename="../../src/game_events/menu_item.hpp" />
|
||||
<Unit filename="../../src/game_events/pump.cpp" />
|
||||
<Unit filename="../../src/game_events/pump.hpp" />
|
||||
<Unit filename="../../src/game_events/wmi_container.cpp" />
|
||||
<Unit filename="../../src/game_events/wmi_container.hpp" />
|
||||
<Unit filename="../../src/game_events/wmi_manager.cpp" />
|
||||
<Unit filename="../../src/game_events/wmi_manager.hpp" />
|
||||
<Unit filename="../../src/game_initialization/configure_engine.cpp" />
|
||||
<Unit filename="../../src/game_initialization/configure_engine.hpp" />
|
||||
<Unit filename="../../src/game_initialization/connect_engine.cpp" />
|
||||
|
|
|
@ -1178,7 +1178,7 @@
|
|||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Game_Events\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Game_Events\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\game_events\wmi_container.cpp">
|
||||
<ClCompile Include="..\..\src\game_events\wmi_manager.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Game_Events\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Game_Events\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)Game_Events\</ObjectFileName>
|
||||
|
@ -3611,7 +3611,7 @@
|
|||
<ClInclude Include="..\..\src\game_events\manager_impl.hpp" />
|
||||
<ClInclude Include="..\..\src\game_events\menu_item.hpp" />
|
||||
<ClInclude Include="..\..\src\game_events\pump.hpp" />
|
||||
<ClInclude Include="..\..\src\game_events\wmi_container.hpp" />
|
||||
<ClInclude Include="..\..\src\game_events\wmi_manager.hpp" />
|
||||
<ClInclude Include="..\..\src\game_initialization\configure_engine.hpp" />
|
||||
<ClInclude Include="..\..\src\game_initialization\connect_engine.hpp" />
|
||||
<ClInclude Include="..\..\src\game_initialization\create_engine.hpp" />
|
||||
|
|
|
@ -697,7 +697,7 @@
|
|||
91E356F81CACC97400774252 /* manager_impl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECDF181E1A3FE0DE00D157A6 /* manager_impl.cpp */; };
|
||||
91E356F91CACC97400774252 /* menu_item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E37E181DDAF90037A62F /* menu_item.cpp */; };
|
||||
91E356FA1CACC97400774252 /* pump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62CC8E7217B9063D00C16B75 /* pump.cpp */; };
|
||||
91E356FB1CACC97400774252 /* wmi_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E380181DDAF90037A62F /* wmi_container.cpp */; };
|
||||
91E356FB1CACC97400774252 /* wmi_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E380181DDAF90037A62F /* wmi_manager.cpp */; };
|
||||
91E356FC1CACC9B200774252 /* configure_engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC2F5FFD1A048E210018C9D6 /* configure_engine.cpp */; };
|
||||
91E356FD1CACC9B200774252 /* connect_engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC2F5FFE1A048E210018C9D6 /* connect_engine.cpp */; };
|
||||
91E356FE1CACC9B200774252 /* create_engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC2F5FFF1A048E210018C9D6 /* create_engine.cpp */; };
|
||||
|
@ -1081,7 +1081,7 @@
|
|||
EC387E70195AFB5C00FC0342 /* drawer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC387E6E195AFB5C00FC0342 /* drawer.cpp */; };
|
||||
EC387E73195AFC8400FC0342 /* fake_unit_ptr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC387E71195AFC8400FC0342 /* fake_unit_ptr.cpp */; };
|
||||
EC44E382181DDAF90037A62F /* menu_item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E37E181DDAF90037A62F /* menu_item.cpp */; };
|
||||
EC44E383181DDAF90037A62F /* wmi_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E380181DDAF90037A62F /* wmi_container.cpp */; };
|
||||
EC44E383181DDAF90037A62F /* wmi_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC44E380181DDAF90037A62F /* wmi_manager.cpp */; };
|
||||
EC45DEDD1AD1CEA300BD760C /* countdown_clock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC45DEDC1AD1CEA300BD760C /* countdown_clock.cpp */; };
|
||||
EC45DEDF1AD1CED100BD760C /* replay_recorder_base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC45DEDE1AD1CED100BD760C /* replay_recorder_base.cpp */; };
|
||||
EC45DEE11AD1CEF600BD760C /* floating_label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC45DEE01AD1CEF600BD760C /* floating_label.cpp */; };
|
||||
|
@ -2409,8 +2409,8 @@
|
|||
EC387E72195AFC8400FC0342 /* fake_unit_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fake_unit_ptr.hpp; sourceTree = "<group>"; };
|
||||
EC44E37E181DDAF90037A62F /* menu_item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu_item.cpp; sourceTree = "<group>"; };
|
||||
EC44E37F181DDAF90037A62F /* menu_item.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = menu_item.hpp; sourceTree = "<group>"; };
|
||||
EC44E380181DDAF90037A62F /* wmi_container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wmi_container.cpp; sourceTree = "<group>"; };
|
||||
EC44E381181DDAF90037A62F /* wmi_container.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wmi_container.hpp; sourceTree = "<group>"; };
|
||||
EC44E380181DDAF90037A62F /* wmi_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wmi_manager.cpp; sourceTree = "<group>"; };
|
||||
EC44E381181DDAF90037A62F /* wmi_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wmi_manager.hpp; sourceTree = "<group>"; };
|
||||
EC45DEDC1AD1CEA300BD760C /* countdown_clock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = countdown_clock.cpp; sourceTree = "<group>"; };
|
||||
EC45DEDE1AD1CED100BD760C /* replay_recorder_base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = replay_recorder_base.cpp; sourceTree = "<group>"; };
|
||||
EC45DEE01AD1CEF600BD760C /* floating_label.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = floating_label.cpp; sourceTree = "<group>"; };
|
||||
|
@ -3362,8 +3362,8 @@
|
|||
EC44E37F181DDAF90037A62F /* menu_item.hpp */,
|
||||
62CC8E7217B9063D00C16B75 /* pump.cpp */,
|
||||
62CC8E7317B9063D00C16B75 /* pump.hpp */,
|
||||
EC44E380181DDAF90037A62F /* wmi_container.cpp */,
|
||||
EC44E381181DDAF90037A62F /* wmi_container.hpp */,
|
||||
EC44E380181DDAF90037A62F /* wmi_manager.cpp */,
|
||||
EC44E381181DDAF90037A62F /* wmi_manager.hpp */,
|
||||
);
|
||||
path = game_events;
|
||||
sourceTree = "<group>";
|
||||
|
@ -5278,7 +5278,7 @@
|
|||
B5A9BD750ECA805A002BE442 /* widget.cpp in Sources */,
|
||||
B597EC5C0FC08E0100CE81F5 /* window_builder.cpp in Sources */,
|
||||
B5A9BD760ECA805A002BE442 /* window.cpp in Sources */,
|
||||
EC44E383181DDAF90037A62F /* wmi_container.cpp in Sources */,
|
||||
EC44E383181DDAF90037A62F /* wmi_manager.cpp in Sources */,
|
||||
ECF3A0B318AD3E8800DD643A /* wml_error.cpp in Sources */,
|
||||
B5599AD30EC62181008DD061 /* wml_exception.cpp in Sources */,
|
||||
B55A80540EDF3DFB00C9D97A /* wml_message.cpp in Sources */,
|
||||
|
@ -5590,7 +5590,7 @@
|
|||
91E356F81CACC97400774252 /* manager_impl.cpp in Sources */,
|
||||
91E356F91CACC97400774252 /* menu_item.cpp in Sources */,
|
||||
91E356FA1CACC97400774252 /* pump.cpp in Sources */,
|
||||
91E356FB1CACC97400774252 /* wmi_container.cpp in Sources */,
|
||||
91E356FB1CACC97400774252 /* wmi_manager.cpp in Sources */,
|
||||
91E356FC1CACC9B200774252 /* configure_engine.cpp in Sources */,
|
||||
91E356FD1CACC9B200774252 /* connect_engine.cpp in Sources */,
|
||||
91E356FE1CACC9B200774252 /* create_engine.cpp in Sources */,
|
||||
|
|
|
@ -125,7 +125,7 @@ game_events/manager.cpp
|
|||
game_events/manager_impl.cpp
|
||||
game_events/menu_item.cpp
|
||||
game_events/pump.cpp
|
||||
game_events/wmi_container.cpp
|
||||
game_events/wmi_manager.cpp
|
||||
game_initialization/configure_engine.cpp
|
||||
game_initialization/connect_engine.cpp
|
||||
game_initialization/create_engine.cpp
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "game_events/handlers.hpp"
|
||||
#include "game_events/wmi_container.hpp"
|
||||
#include "game_events/wmi_manager.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
@ -96,7 +96,7 @@ namespace game_events {
|
|||
std::set<std::string> unit_wml_ids_;
|
||||
|
||||
const std::unique_ptr<game_events::wml_event_pump> pump_;
|
||||
game_events::wmi_container wml_menu_items_;
|
||||
game_events::wmi_manager wml_menu_items_;
|
||||
|
||||
public:
|
||||
manager(const manager&) = delete;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Definitions for a container for wml_menu_item.
|
||||
*/
|
||||
|
||||
#include "game_events/wmi_container.hpp"
|
||||
#include "game_events/wmi_manager.hpp"
|
||||
#include "game_events/handlers.hpp"
|
||||
#include "game_events/menu_item.hpp"
|
||||
#include "play_controller.hpp"
|
||||
|
@ -36,7 +36,7 @@ static lg::log_domain log_engine("engine");
|
|||
// This file is in the game_events namespace.
|
||||
namespace game_events
|
||||
{
|
||||
wmi_container::wmi_container()
|
||||
wmi_manager::wmi_manager()
|
||||
: wml_menu_items_()
|
||||
{
|
||||
}
|
||||
|
@ -46,12 +46,12 @@ wmi_container::wmi_container()
|
|||
* Default implementation, but defined here because this function needs to be
|
||||
* able to see wml_menu_item's destructor.
|
||||
*/
|
||||
wmi_container::~wmi_container()
|
||||
wmi_manager::~wmi_manager()
|
||||
{
|
||||
}
|
||||
|
||||
/** Erases the item with id @a key. */
|
||||
bool wmi_container::erase(const std::string& id)
|
||||
bool wmi_manager::erase(const std::string& id)
|
||||
{
|
||||
// Locate the item to erase.
|
||||
const auto iter = wml_menu_items_.find(id);
|
||||
|
@ -77,7 +77,7 @@ bool wmi_container::erase(const std::string& id)
|
|||
* NOTE: The return value could be altered if it is decided that
|
||||
* play_controller::execute_command() needs something different.
|
||||
*/
|
||||
bool wmi_container::fire_item(
|
||||
bool wmi_manager::fire_item(
|
||||
const std::string& id, const map_location& hex, game_data& gamedata, filter_context& fc, unit_map& units) const
|
||||
{
|
||||
// Does this item exist?
|
||||
|
@ -104,7 +104,7 @@ bool wmi_container::fire_item(
|
|||
* @param[out] items Pointers to applicable menu items will be pushed onto @a items.
|
||||
* @param[out] descriptions Menu item text will be pushed onto @a descriptions (in the same order as @a items).
|
||||
*/
|
||||
void wmi_container::get_items(const map_location& hex,
|
||||
void wmi_manager::get_items(const map_location& hex,
|
||||
std::vector<std::shared_ptr<const wml_menu_item>>& items,
|
||||
std::vector<config>& descriptions,
|
||||
filter_context& fc,
|
||||
|
@ -135,7 +135,7 @@ void wmi_container::get_items(const map_location& hex,
|
|||
}
|
||||
}
|
||||
|
||||
wmi_container::item_ptr wmi_container::get_item(const std::string& id) const
|
||||
wmi_manager::item_ptr wmi_manager::get_item(const std::string& id) const
|
||||
{
|
||||
auto iter = wml_menu_items_.find(id);
|
||||
if(iter == wml_menu_items_.end()) {
|
||||
|
@ -148,7 +148,7 @@ wmi_container::item_ptr wmi_container::get_item(const std::string& id) const
|
|||
/**
|
||||
* Initializes the implicit event handlers for inlined [command]s.
|
||||
*/
|
||||
void wmi_container::init_handlers() const
|
||||
void wmi_manager::init_handlers() const
|
||||
{
|
||||
// Applying default hotkeys here currently does not work because
|
||||
// the hotkeys are reset by play_controler::init_managers() ->
|
||||
|
@ -176,7 +176,7 @@ void wmi_container::init_handlers() const
|
|||
}
|
||||
}
|
||||
|
||||
void wmi_container::to_config(config& cfg) const
|
||||
void wmi_manager::to_config(config& cfg) const
|
||||
{
|
||||
// Loop through our items.
|
||||
for(const auto& item : wml_menu_items_) {
|
||||
|
@ -188,7 +188,7 @@ void wmi_container::to_config(config& cfg) const
|
|||
/**
|
||||
* Updates or creates (as appropriate) the menu item with the given @a id.
|
||||
*/
|
||||
void wmi_container::set_item(const std::string& id, const vconfig& menu_item)
|
||||
void wmi_manager::set_item(const std::string& id, const vconfig& menu_item)
|
||||
{
|
||||
// Try to insert a dummy value. This combines looking for an existing
|
||||
// entry with insertion.
|
||||
|
@ -206,7 +206,7 @@ void wmi_container::set_item(const std::string& id, const vconfig& menu_item)
|
|||
/**
|
||||
* Sets the current menu items to the "menu_item" children of @a cfg.
|
||||
*/
|
||||
void wmi_container::set_menu_items(const config& cfg)
|
||||
void wmi_manager::set_menu_items(const config& cfg)
|
||||
{
|
||||
wml_menu_items_.clear();
|
||||
for(const config& item : cfg.child_range("menu_item")) {
|
|
@ -36,14 +36,14 @@ namespace game_events
|
|||
class wml_menu_item;
|
||||
|
||||
/// A container of wml_menu_item.
|
||||
class wmi_container
|
||||
class wmi_manager
|
||||
{
|
||||
public:
|
||||
/// Pointers to our elements.
|
||||
typedef std::shared_ptr<wml_menu_item> item_ptr;
|
||||
|
||||
wmi_container();
|
||||
~wmi_container();
|
||||
wmi_manager();
|
||||
~wmi_manager();
|
||||
|
||||
/// Returns true if *this contains no data.
|
||||
bool empty() const { return wml_menu_items_.empty(); }
|
|
@ -382,12 +382,12 @@ bool game_state::side_can_recruit_on(int side, map_location hex) const
|
|||
return false;
|
||||
}
|
||||
|
||||
game_events::wmi_container& game_state::get_wml_menu_items()
|
||||
game_events::wmi_manager& game_state::get_wml_menu_items()
|
||||
{
|
||||
return this->events_manager_->wml_menu_items_;
|
||||
}
|
||||
|
||||
const game_events::wmi_container& game_state::get_wml_menu_items() const
|
||||
const game_events::wmi_manager& game_state::get_wml_menu_items() const
|
||||
{
|
||||
return this->events_manager_->wml_menu_items_;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class play_controller;
|
|||
class game_lua_kernel;
|
||||
class reports;
|
||||
|
||||
namespace game_events { class manager; class wmi_container; }
|
||||
namespace game_events { class manager; class wmi_manager; }
|
||||
namespace game_events { struct event_context; }
|
||||
|
||||
namespace pathfind { class manager; }
|
||||
|
@ -62,8 +62,8 @@ public:
|
|||
bool& init_side_done() { return init_side_done_; }
|
||||
|
||||
|
||||
game_events::wmi_container& get_wml_menu_items();
|
||||
const game_events::wmi_container& get_wml_menu_items() const;
|
||||
game_events::wmi_manager& get_wml_menu_items();
|
||||
const game_events::wmi_manager& get_wml_menu_items() const;
|
||||
int first_human_team_; //needed to initialize the viewpoint during setup
|
||||
bool has_human_sides() const { return first_human_team_ != -1; }
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "game_display.hpp"
|
||||
#include "game_errors.hpp"
|
||||
#include "game_events/menu_item.hpp"
|
||||
#include "game_events/wmi_container.hpp"
|
||||
#include "game_events/wmi_manager.hpp"
|
||||
#include "preferences/game.hpp"
|
||||
#include "game_state.hpp"
|
||||
#include "hotkey/hotkey_command.hpp"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "playsingle_controller.hpp"
|
||||
#include "whiteboard/manager.hpp"
|
||||
#include "game_events/menu_item.hpp"
|
||||
#include "game_events/wmi_container.hpp"
|
||||
#include "game_events/wmi_manager.hpp"
|
||||
#include "map/map.hpp"
|
||||
#include "save_index.hpp"
|
||||
#include "gui/dialogs/message.hpp"
|
||||
|
@ -205,7 +205,7 @@ bool playsingle_controller::hotkey_handler::can_execute_command(const hotkey::ho
|
|||
return false;
|
||||
}
|
||||
|
||||
game_events::wmi_container::item_ptr item = gamestate().get_wml_menu_items().get_item(cmd.command.substr(prefixlen));
|
||||
game_events::wmi_manager::item_ptr item = gamestate().get_wml_menu_items().get_item(cmd.command.substr(prefixlen));
|
||||
if(!item) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue