Formatting cleanup: > >
to '>>`
Allowed since C++11. Might as well use it everywhere.
This commit is contained in:
parent
c38ff3856f
commit
e270a7c665
94 changed files with 330 additions and 330 deletions
|
@ -649,7 +649,7 @@ game_events::pump_result_t actor_sighted(const unit & target, const std::vector<
|
|||
needs_event[i] = needs_event[i] && target.is_visible_to_team(teams[i], *resources::gameboard, false);
|
||||
|
||||
// Cache "jamming".
|
||||
std::vector< std::map<map_location, int> > jamming_cache(teams_size);
|
||||
std::vector< std::map<map_location, int>> jamming_cache(teams_size);
|
||||
for ( size_t i = 0; i != teams_size; ++i )
|
||||
if ( needs_event[i] )
|
||||
create_jamming_map(jamming_cache[i], teams[i]);
|
||||
|
|
|
@ -182,7 +182,7 @@ static std::string strip_cr(std::string str, bool strip)
|
|||
}
|
||||
|
||||
namespace {
|
||||
void append_default_ignore_patterns(std::pair<std::vector<std::string>, std::vector<std::string> >& patterns)
|
||||
void append_default_ignore_patterns(std::pair<std::vector<std::string>, std::vector<std::string>>& patterns)
|
||||
{
|
||||
std::vector<std::string>& files = patterns.first;
|
||||
std::vector<std::string>& dirs = patterns.second;
|
||||
|
@ -224,12 +224,12 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
static std::pair<std::vector<std::string>, std::vector<std::string> > read_ignore_patterns(const std::string& addon_name)
|
||||
static std::pair<std::vector<std::string>, std::vector<std::string>> read_ignore_patterns(const std::string& addon_name)
|
||||
{
|
||||
const std::string parentd = filesystem::get_addons_dir();
|
||||
const std::string ign_file = parentd + "/" + addon_name + "/_server.ign";
|
||||
|
||||
std::pair<std::vector<std::string>, std::vector<std::string> > patterns;
|
||||
std::pair<std::vector<std::string>, std::vector<std::string>> patterns;
|
||||
LOG_CFG << "searching for .ign file for '" << addon_name << "'...\n";
|
||||
if (!filesystem::file_exists(ign_file)) {
|
||||
LOG_CFG << "no .ign file found for '" << addon_name << "'\n"
|
||||
|
@ -261,7 +261,7 @@ static void archive_file(const std::string& path, const std::string& fname, conf
|
|||
cfg["contents"] = encode_binary(strip_cr(filesystem::read_file(path + '/' + fname),is_cfg));
|
||||
}
|
||||
|
||||
static void archive_dir(const std::string& path, const std::string& dirname, config& cfg, std::pair<std::vector<std::string>, std::vector<std::string> >& ignore_patterns)
|
||||
static void archive_dir(const std::string& path, const std::string& dirname, config& cfg, std::pair<std::vector<std::string>, std::vector<std::string>>& ignore_patterns)
|
||||
{
|
||||
cfg["name"] = dirname;
|
||||
const std::string dir = path + '/' + dirname;
|
||||
|
@ -299,7 +299,7 @@ void archive_addon(const std::string& addon_name, config& cfg)
|
|||
{
|
||||
const std::string parentd = filesystem::get_addons_dir();
|
||||
|
||||
std::pair<std::vector<std::string>, std::vector<std::string> > ignore_patterns;
|
||||
std::pair<std::vector<std::string>, std::vector<std::string>> ignore_patterns;
|
||||
ignore_patterns = read_ignore_patterns(addon_name);
|
||||
archive_dir(parentd, addon_name, cfg.add_child("dir"), ignore_patterns);
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
protected:
|
||||
mutable std::shared_ptr<T> value_;
|
||||
mutable std::shared_ptr<wfl::variant> value_variant_;
|
||||
mutable std::shared_ptr< lua_object<T> > value_lua_;
|
||||
mutable std::shared_ptr< lua_object<T>> value_lua_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -218,14 +218,14 @@ class composite_aspect;
|
|||
template<typename T>
|
||||
class typesafe_known_aspect : public known_aspect {
|
||||
public:
|
||||
typesafe_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect<T> > &where, aspect_map &aspects)
|
||||
typesafe_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect<T>> &where, aspect_map &aspects)
|
||||
: known_aspect(name), where_(where), aspects_(aspects)
|
||||
{
|
||||
}
|
||||
|
||||
void set(aspect_ptr a)
|
||||
{
|
||||
std::shared_ptr< typesafe_aspect <T> > c = std::dynamic_pointer_cast< typesafe_aspect<T> >(a);
|
||||
std::shared_ptr< typesafe_aspect <T>> c = std::dynamic_pointer_cast< typesafe_aspect<T>>(a);
|
||||
if (c) {
|
||||
assert (c->get_id()== this->get_name());
|
||||
where_ = c;
|
||||
|
@ -237,7 +237,7 @@ public:
|
|||
|
||||
virtual void add_facet(const config &cfg)
|
||||
{
|
||||
std::shared_ptr< composite_aspect <T> > c = std::dynamic_pointer_cast< composite_aspect<T> >(where_);
|
||||
std::shared_ptr< composite_aspect <T>> c = std::dynamic_pointer_cast< composite_aspect<T>>(where_);
|
||||
if (c) {
|
||||
assert (c->get_id()==this->get_name());
|
||||
c->add_facet(-1, cfg);
|
||||
|
@ -248,7 +248,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
std::shared_ptr<typesafe_aspect <T> > &where_;
|
||||
std::shared_ptr<typesafe_aspect <T>> &where_;
|
||||
aspect_map &aspects_;
|
||||
|
||||
};
|
||||
|
@ -274,7 +274,7 @@ public:
|
|||
std::vector< aspect_ptr > default_aspects;
|
||||
engine::parse_aspect_from_config(*this,_default,parent_id_,std::back_inserter(default_aspects));
|
||||
if (!default_aspects.empty()) {
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T> >(default_aspects.front());
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T>>(default_aspects.front());
|
||||
if (composite_aspect<T>* c = dynamic_cast<composite_aspect<T>*>(b.get())) {
|
||||
c->parent_id_ = parent_id_;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ public:
|
|||
std::vector<aspect_ptr> facets_base;
|
||||
engine::parse_aspect_from_config(*this,cfg,parent_id_,std::back_inserter(facets_base));
|
||||
for (aspect_ptr a : facets_base) {
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T> > (a);
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T>> (a);
|
||||
if (composite_aspect<T>* c = dynamic_cast<composite_aspect<T>*>(b.get())) {
|
||||
c->parent_id_ = parent_id_;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ public:
|
|||
engine::parse_aspect_from_config(*this,cfg,parent_id_,std::back_inserter(facets));
|
||||
int j=0;
|
||||
for (aspect_ptr a : facets) {
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T> > (a);
|
||||
typename aspect_type<T>::typesafe_ptr b = std::dynamic_pointer_cast< typesafe_aspect<T>> (a);
|
||||
if (composite_aspect<T>* c = dynamic_cast<composite_aspect<T>*>(b.get())) {
|
||||
c->parent_id_ = parent_id_;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ bool engine::is_ok() const
|
|||
return true;
|
||||
}
|
||||
|
||||
void engine::parse_aspect_from_config( readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr > > b )
|
||||
void engine::parse_aspect_from_config( readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr >> b )
|
||||
{
|
||||
engine_ptr eng = context.get_engine_by_cfg(cfg);
|
||||
if (eng){
|
||||
|
@ -57,7 +57,7 @@ void engine::parse_aspect_from_config( readonly_context &context, const config &
|
|||
}
|
||||
}
|
||||
|
||||
void engine::parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b )
|
||||
void engine::parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b )
|
||||
{
|
||||
engine_ptr eng = context.get_engine_by_cfg(cfg);
|
||||
if (eng){
|
||||
|
@ -66,7 +66,7 @@ void engine::parse_candidate_action_from_config( rca_context &context, const con
|
|||
}
|
||||
}
|
||||
|
||||
void engine::parse_engine_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< engine_ptr > > b )
|
||||
void engine::parse_engine_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< engine_ptr >> b )
|
||||
{
|
||||
engine_ptr eng = context.get_engine_by_cfg(cfg);
|
||||
if (eng){
|
||||
|
@ -76,7 +76,7 @@ void engine::parse_engine_from_config( readonly_context &context, const config &
|
|||
}
|
||||
|
||||
|
||||
void engine::parse_goal_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< goal_ptr > > b )
|
||||
void engine::parse_goal_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< goal_ptr >> b )
|
||||
{
|
||||
engine_ptr eng = context.get_engine_by_cfg(cfg);
|
||||
if (eng){
|
||||
|
@ -86,7 +86,7 @@ void engine::parse_goal_from_config( readonly_context &context, const config &cf
|
|||
}
|
||||
|
||||
|
||||
void engine::parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b )
|
||||
void engine::parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b )
|
||||
{
|
||||
engine_ptr eng = context.get_engine_by_cfg(cfg);
|
||||
if (eng){
|
||||
|
@ -95,27 +95,27 @@ void engine::parse_stage_from_config( ai_context &context, const config &cfg, st
|
|||
}
|
||||
}
|
||||
|
||||
void engine::do_parse_aspect_from_config( const config &/*cfg*/, const std::string &/*id*/, std::back_insert_iterator< std::vector<aspect_ptr> > /*b*/ )
|
||||
void engine::do_parse_aspect_from_config( const config &/*cfg*/, const std::string &/*id*/, std::back_insert_iterator< std::vector<aspect_ptr>> /*b*/ )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void engine::do_parse_candidate_action_from_config( rca_context &/*context*/, const config &/*cfg*/, std::back_insert_iterator<std::vector< candidate_action_ptr > > /*b*/ ){
|
||||
void engine::do_parse_candidate_action_from_config( rca_context &/*context*/, const config &/*cfg*/, std::back_insert_iterator<std::vector< candidate_action_ptr >> /*b*/ ){
|
||||
|
||||
}
|
||||
|
||||
void engine::do_parse_engine_from_config( const config &/*cfg*/, std::back_insert_iterator<std::vector< engine_ptr > > /*b*/ ){
|
||||
void engine::do_parse_engine_from_config( const config &/*cfg*/, std::back_insert_iterator<std::vector< engine_ptr >> /*b*/ ){
|
||||
|
||||
}
|
||||
|
||||
|
||||
void engine::do_parse_goal_from_config( const config &/*cfg*/, std::back_insert_iterator<std::vector< goal_ptr > > /*b*/ ){
|
||||
void engine::do_parse_goal_from_config( const config &/*cfg*/, std::back_insert_iterator<std::vector< goal_ptr >> /*b*/ ){
|
||||
|
||||
}
|
||||
|
||||
|
||||
void engine::do_parse_stage_from_config( ai_context &/*context*/, const config &/*cfg*/, std::back_insert_iterator<std::vector< stage_ptr > > /*b*/ )
|
||||
void engine::do_parse_stage_from_config( ai_context &/*context*/, const config &/*cfg*/, std::back_insert_iterator<std::vector< stage_ptr >> /*b*/ )
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -43,37 +43,37 @@ public:
|
|||
|
||||
virtual bool is_ok() const;
|
||||
|
||||
static void parse_aspect_from_config( readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr > > b );
|
||||
static void parse_aspect_from_config( readonly_context &context, const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr >> b );
|
||||
|
||||
|
||||
static void parse_goal_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< goal_ptr > > b );
|
||||
static void parse_goal_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< goal_ptr >> b );
|
||||
|
||||
|
||||
static void parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b );
|
||||
static void parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b );
|
||||
|
||||
|
||||
static void parse_engine_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< engine_ptr > > b );
|
||||
static void parse_engine_from_config( readonly_context &context, const config &cfg, std::back_insert_iterator<std::vector< engine_ptr >> b );
|
||||
|
||||
|
||||
static void parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b );
|
||||
static void parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b );
|
||||
|
||||
|
||||
//do not override that method in subclasses which cannot create aspects
|
||||
virtual void do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr> > b );
|
||||
virtual void do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr>> b );
|
||||
|
||||
|
||||
//do not override that method in subclasses which cannot create candidate_actions
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b );
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b );
|
||||
|
||||
//do not override that method in subclasses which cannot create goals
|
||||
virtual void do_parse_goal_from_config( const config &cfg, std::back_insert_iterator<std::vector< goal_ptr > > b );
|
||||
virtual void do_parse_goal_from_config( const config &cfg, std::back_insert_iterator<std::vector< goal_ptr >> b );
|
||||
|
||||
//do not override that method in subclasses which cannot create engines
|
||||
virtual void do_parse_engine_from_config( const config &cfg, std::back_insert_iterator<std::vector< engine_ptr > > b );
|
||||
virtual void do_parse_engine_from_config( const config &cfg, std::back_insert_iterator<std::vector< engine_ptr >> b );
|
||||
|
||||
|
||||
//do not override that method in subclasses which cannot create stages
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b );
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b );
|
||||
|
||||
//do not override that method in subclasses which cannot evaluate formulas
|
||||
virtual std::string evaluate(const std::string& str);
|
||||
|
|
|
@ -75,7 +75,7 @@ goal::~goal()
|
|||
}
|
||||
|
||||
|
||||
void goal::add_targets(std::back_insert_iterator< std::vector< target > > /*target_list*/)
|
||||
void goal::add_targets(std::back_insert_iterator< std::vector< target >> /*target_list*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ void target_unit_goal::on_create()
|
|||
}
|
||||
}
|
||||
|
||||
void target_unit_goal::add_targets(std::back_insert_iterator< std::vector< target > > target_list)
|
||||
void target_unit_goal::add_targets(std::back_insert_iterator< std::vector< target >> target_list)
|
||||
{
|
||||
if (!(this)->active()) {
|
||||
return;
|
||||
|
@ -181,7 +181,7 @@ void target_location_goal::on_create()
|
|||
}
|
||||
}
|
||||
|
||||
void target_location_goal::add_targets(std::back_insert_iterator< std::vector< target > > target_list)
|
||||
void target_location_goal::add_targets(std::back_insert_iterator< std::vector< target >> target_list)
|
||||
{
|
||||
if (!(this)->active()) {
|
||||
return;
|
||||
|
@ -235,7 +235,7 @@ void protect_goal::on_create()
|
|||
}
|
||||
|
||||
|
||||
void protect_goal::add_targets(std::back_insert_iterator< std::vector< target > > target_list)
|
||||
void protect_goal::add_targets(std::back_insert_iterator< std::vector< target >> target_list)
|
||||
{
|
||||
std::string goal_type;
|
||||
if (protect_unit_) {
|
||||
|
@ -323,7 +323,7 @@ void lua_goal::on_create(std::shared_ptr<ai::lua_ai_context> l_ctx)
|
|||
handler_.reset(resources::lua_kernel->create_lua_ai_action_handler(code_.c_str(), *l_ctx));
|
||||
}
|
||||
|
||||
void lua_goal::add_targets(std::back_insert_iterator< std::vector< target > > target_list)
|
||||
void lua_goal::add_targets(std::back_insert_iterator< std::vector< target >> target_list)
|
||||
{
|
||||
std::shared_ptr<lua_object<std::vector<target>>> l_obj = std::make_shared<lua_object<std::vector<target>>>();
|
||||
config c(cfg_.child_or_empty("args"));
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
virtual ~goal();
|
||||
|
||||
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target > > target_list);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target >> target_list);
|
||||
|
||||
|
||||
virtual config to_config() const;
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
target_unit_goal(readonly_context &context, const config &cfg);
|
||||
|
||||
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target > > target_list);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target >> target_list);
|
||||
|
||||
|
||||
virtual void on_create();
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
target_location_goal(readonly_context &context, const config &cfg);
|
||||
|
||||
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target > > target_list);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target >> target_list);
|
||||
|
||||
|
||||
virtual void on_create();
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
protect_goal(readonly_context &context, const config &cfg, bool protect_unit);
|
||||
|
||||
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target > > target_list);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target >> target_list);
|
||||
|
||||
|
||||
virtual void on_create();
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
class lua_goal : public goal {
|
||||
public:
|
||||
lua_goal(readonly_context& context, const config& cfg);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target > > target_list);
|
||||
virtual void add_targets(std::back_insert_iterator< std::vector< target >> target_list);
|
||||
void on_create(std::shared_ptr<ai::lua_ai_context>);
|
||||
|
||||
private:
|
||||
|
|
|
@ -74,7 +74,7 @@ template<typename T>
|
|||
class vector_property_handler : public base_property_handler {
|
||||
public:
|
||||
typedef std::shared_ptr<T> ptr;
|
||||
typedef std::vector< std::shared_ptr<T> > ptr_vector;
|
||||
typedef std::vector< std::shared_ptr<T>> ptr_vector;
|
||||
|
||||
vector_property_handler(const std::string &property, ptr_vector &values, std::function<void(ptr_vector&, const config&)> &construction_factory)
|
||||
: factory_(construction_factory), property_(property), values_(values){}
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
};
|
||||
|
||||
template<>
|
||||
class config_value_translator< std::vector<std::string> > {
|
||||
class config_value_translator< std::vector<std::string>> {
|
||||
public:
|
||||
|
||||
static std::vector<std::string> cfg_to_value(const config &cfg)
|
||||
|
|
|
@ -282,7 +282,7 @@ void configuration::expand_simplified_aspects(side_number side, config &cfg) {
|
|||
lg::wml_error() << "side " << side << " has two [ai] tags with contradictory ai_algorithm - the first one will take precedence.\n";
|
||||
}
|
||||
}
|
||||
std::deque<std::pair<std::string, config> > facet_configs;
|
||||
std::deque<std::pair<std::string, config>> facet_configs;
|
||||
for (const config::attribute &attr : aiparam.attribute_range()) {
|
||||
if (non_aspect_attributes.count(attr.first)) {
|
||||
continue;
|
||||
|
|
|
@ -174,9 +174,9 @@ synced_command_result_ptr readonly_context_impl::check_synced_command_action(con
|
|||
|
||||
|
||||
template<typename T>
|
||||
void readonly_context_impl::add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect <T> > &where)
|
||||
void readonly_context_impl::add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect <T>> &where)
|
||||
{
|
||||
std::shared_ptr< typesafe_known_aspect <T> > ka_ptr(new typesafe_known_aspect<T>(name,where,aspects_));
|
||||
std::shared_ptr< typesafe_known_aspect <T>> ka_ptr(new typesafe_known_aspect<T>(name,where,aspects_));
|
||||
known_aspects_.emplace(name,ka_ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ public:
|
|||
|
||||
|
||||
typedef std::map<std::pair<map_location,const unit_type *>,
|
||||
std::pair<battle_context_unit_stats,battle_context_unit_stats> >
|
||||
std::pair<battle_context_unit_stats,battle_context_unit_stats>>
|
||||
unit_stats_cache_t;
|
||||
virtual unit_stats_cache_t & unit_stats_cache() const = 0;
|
||||
|
||||
|
@ -1495,7 +1495,7 @@ public:
|
|||
|
||||
private:
|
||||
template<typename T>
|
||||
void add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect <T> >& where);
|
||||
void add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect <T>>& where);
|
||||
|
||||
const config cfg_;
|
||||
|
||||
|
@ -1536,8 +1536,8 @@ private:
|
|||
mutable moves_map possible_moves_;
|
||||
aspect_type< double >::typesafe_ptr recruitment_diversity_;
|
||||
aspect_type< config >::typesafe_ptr recruitment_instructions_;
|
||||
aspect_type< std::vector<std::string> >::typesafe_ptr recruitment_more_;
|
||||
aspect_type< std::vector<std::string> >::typesafe_ptr recruitment_pattern_;
|
||||
aspect_type< std::vector<std::string>>::typesafe_ptr recruitment_more_;
|
||||
aspect_type< std::vector<std::string>>::typesafe_ptr recruitment_pattern_;
|
||||
aspect_type< int >::typesafe_ptr recruitment_randomness_;
|
||||
aspect_type< config >::typesafe_ptr recruitment_save_gold_;
|
||||
recursion_counter recursion_counter_;
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
virtual void recalculate() const;
|
||||
private:
|
||||
std::shared_ptr<lua_ai_action_handler> handler_;
|
||||
mutable std::shared_ptr<lua_object<aspect_attacks_lua_filter> > obj_;
|
||||
mutable std::shared_ptr<lua_object<aspect_attacks_lua_filter>> obj_;
|
||||
std::string code_;
|
||||
const config params_;
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ void attack_analysis::analyze(const gamemap& map, unit_map& units,
|
|||
|
||||
double prob_dead_already = 0.0;
|
||||
assert(!movements.empty());
|
||||
std::vector<std::pair<map_location,map_location> >::const_iterator m;
|
||||
std::vector<std::pair<map_location,map_location>>::const_iterator m;
|
||||
|
||||
std::unique_ptr<battle_context> bc(nullptr);
|
||||
std::unique_ptr<battle_context> old_bc(nullptr);
|
||||
|
|
|
@ -881,7 +881,7 @@ bool get_villages_phase::dispatch_village_simple(
|
|||
|
||||
// build the reverse map
|
||||
std::map<map_location /*village location*/,
|
||||
std::vector<map_location /* units that can reach it*/> >reversemap;
|
||||
std::vector<map_location /* units that can reach it*/>>reversemap;
|
||||
|
||||
treachmap::const_iterator itor = reachmap.begin();
|
||||
for(;itor != reachmap.end(); ++itor) {
|
||||
|
@ -1131,7 +1131,7 @@ void get_villages_phase::dispatch_complex(
|
|||
// - dispatch and ready
|
||||
// - is it's result better as the last best
|
||||
// - store
|
||||
std::vector<std::pair<map_location, map_location> > best_result;
|
||||
std::vector<std::pair<map_location, map_location>> best_result;
|
||||
|
||||
// Bruteforcing all possible permutations can result in a slow game.
|
||||
// So there needs to be a balance between the best possible result and
|
||||
|
@ -1153,7 +1153,7 @@ void get_villages_phase::dispatch_complex(
|
|||
while(std::next_permutation(perm.begin(), perm.end())) {
|
||||
|
||||
// Get result for current permutation.
|
||||
std::vector<std::pair<map_location,map_location> > result;
|
||||
std::vector<std::pair<map_location,map_location>> result;
|
||||
for(size_t u = 0; u < max_options; ++u) {
|
||||
if(matrix[u][perm[u]]) {
|
||||
result.emplace_back(villages[perm[u]], units[u]);
|
||||
|
@ -1191,7 +1191,7 @@ void get_villages_phase::dispatch_complex(
|
|||
}
|
||||
while(std::next_permutation(perm.begin(), perm.end())) {
|
||||
// Get result for current permutation.
|
||||
std::vector<std::pair<map_location,map_location> > result;
|
||||
std::vector<std::pair<map_location,map_location>> result;
|
||||
for(size_t u = 0; u < unit_count; ++u) {
|
||||
if(matrix[u][perm[u]]) {
|
||||
result.emplace_back(villages[perm[u]], units[u]);
|
||||
|
@ -1233,7 +1233,7 @@ void get_villages_phase::dispatch_complex(
|
|||
}
|
||||
while(std::next_permutation(perm.begin(), perm.end())) {
|
||||
// Get result for current permutation.
|
||||
std::vector<std::pair<map_location,map_location> > result;
|
||||
std::vector<std::pair<map_location,map_location>> result;
|
||||
for(size_t v = 0; v < village_count; ++v) {
|
||||
if(matrix[perm[v]][v]) {
|
||||
result.emplace_back(villages[v], units[perm[v]]);
|
||||
|
|
|
@ -134,10 +134,10 @@ private:
|
|||
bool debug_;
|
||||
|
||||
typedef std::map<map_location /* unit location */,
|
||||
std::vector<map_location /* villages we can reach */> > treachmap;
|
||||
std::vector<map_location /* villages we can reach */>> treachmap;
|
||||
|
||||
typedef std::vector<std::pair<map_location /* destination */,
|
||||
map_location /* start */ > > tmoves;
|
||||
map_location /* start */ >> tmoves;
|
||||
|
||||
|
||||
// The list of moves we want to make
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
bool attack_close(const map_location& loc) const;
|
||||
|
||||
map_location target;
|
||||
std::vector<std::pair<map_location,map_location> > movements;
|
||||
std::vector<std::pair<map_location,map_location>> movements;
|
||||
|
||||
/** The value of the unit being targeted. */
|
||||
double target_value;
|
||||
|
|
|
@ -43,7 +43,7 @@ engine_cpp::~engine_cpp()
|
|||
}
|
||||
|
||||
|
||||
void engine_cpp::do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr > > b )
|
||||
void engine_cpp::do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr >> b )
|
||||
{
|
||||
const std::string aspect_factory_key = id+"*"+cfg["name"];//@note: hack which combines aspect id and name to get the std::string key of the aspect factory
|
||||
aspect_factory::factory_map::iterator f = aspect_factory::get_list().find(aspect_factory_key);
|
||||
|
@ -62,7 +62,7 @@ void engine_cpp::do_parse_aspect_from_config( const config &cfg, const std::stri
|
|||
}
|
||||
|
||||
|
||||
void engine_cpp::do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b ){
|
||||
void engine_cpp::do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b ){
|
||||
candidate_action_factory::factory_map::iterator f = candidate_action_factory::get_list().find(cfg["name"]);
|
||||
if (f == candidate_action_factory::get_list().end()){
|
||||
ERR_AI_ENGINE_CPP << "side "<<ai_.get_side()<< " : UNKNOWN candidate_action["<<cfg["name"]<<"]"<< std::endl;
|
||||
|
@ -79,7 +79,7 @@ void engine_cpp::do_parse_candidate_action_from_config( rca_context &context, co
|
|||
|
||||
}
|
||||
|
||||
void engine_cpp::do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b )
|
||||
void engine_cpp::do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b )
|
||||
{
|
||||
stage_factory::factory_map::iterator f = stage_factory::get_list().find(cfg["name"]);
|
||||
if (f == stage_factory::get_list().end()){
|
||||
|
@ -97,7 +97,7 @@ void engine_cpp::do_parse_stage_from_config( ai_context &context, const config &
|
|||
}
|
||||
|
||||
|
||||
void engine_cpp::do_parse_goal_from_config(const config &cfg, std::back_insert_iterator<std::vector< goal_ptr > > b )
|
||||
void engine_cpp::do_parse_goal_from_config(const config &cfg, std::back_insert_iterator<std::vector< goal_ptr >> b )
|
||||
{
|
||||
goal_factory::factory_map::iterator f = goal_factory::get_list().find(cfg["name"]);
|
||||
if (f == goal_factory::get_list().end()){
|
||||
|
@ -115,7 +115,7 @@ void engine_cpp::do_parse_goal_from_config(const config &cfg, std::back_insert_i
|
|||
}
|
||||
|
||||
|
||||
void engine_cpp::do_parse_engine_from_config(const config &cfg, std::back_insert_iterator<std::vector< engine_ptr > > b )
|
||||
void engine_cpp::do_parse_engine_from_config(const config &cfg, std::back_insert_iterator<std::vector< engine_ptr >> b )
|
||||
{
|
||||
engine_factory::factory_map::iterator f = engine_factory::get_list().find(cfg["name"]);
|
||||
if (f == engine_factory::get_list().end()){
|
||||
|
|
|
@ -32,18 +32,18 @@ public:
|
|||
virtual ~engine_cpp();
|
||||
|
||||
|
||||
void do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr > > b );
|
||||
void do_parse_aspect_from_config( const config &cfg, const std::string &id, std::back_insert_iterator<std::vector< aspect_ptr >> b );
|
||||
|
||||
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b );
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b );
|
||||
|
||||
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b );
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b );
|
||||
|
||||
|
||||
virtual void do_parse_goal_from_config(const config &cfg, std::back_insert_iterator<std::vector< goal_ptr > > b );
|
||||
virtual void do_parse_goal_from_config(const config &cfg, std::back_insert_iterator<std::vector< goal_ptr >> b );
|
||||
|
||||
virtual void do_parse_engine_from_config(const config &cfg, std::back_insert_iterator<std::vector< engine_ptr > > b );
|
||||
virtual void do_parse_engine_from_config(const config &cfg, std::back_insert_iterator<std::vector< engine_ptr >> b );
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -936,7 +936,7 @@ void recruitment::do_combat_analysis(std::vector<data>* leader_data) {
|
|||
const unit_map& units = resources::gameboard->units();
|
||||
|
||||
// Collect all enemy units (and their hp) we want to take into account in enemy_units.
|
||||
typedef std::vector<std::pair<std::string, int> > unit_hp_vector;
|
||||
typedef std::vector<std::pair<std::string, int>> unit_hp_vector;
|
||||
unit_hp_vector enemy_units;
|
||||
for (const unit& unit : units) {
|
||||
if (!current_team().is_enemy(unit.side()) || unit.incapacitated()) {
|
||||
|
@ -1816,9 +1816,9 @@ recruitment_aspect::recruitment_aspect(readonly_context &context, const config &
|
|||
for (config lim : parsed_cfg.child_range("limit")) {
|
||||
create_limit(limits_, lim);
|
||||
}
|
||||
std::function<void(std::vector<std::shared_ptr<recruit_job> >&, const config&)> factory_jobs =
|
||||
std::function<void(std::vector<std::shared_ptr<recruit_job>>&, const config&)> factory_jobs =
|
||||
std::bind(&recruitment_aspect::create_job,*this,_1,_2);
|
||||
std::function<void(std::vector<std::shared_ptr<recruit_limit> >&, const config&)> factory_limits =
|
||||
std::function<void(std::vector<std::shared_ptr<recruit_limit>>&, const config&)> factory_limits =
|
||||
std::bind(&recruitment_aspect::create_limit,*this,_1,_2);
|
||||
register_vector_property(property_handlers(), "recruit", jobs_, factory_jobs);
|
||||
register_vector_property(property_handlers(), "limit", limits_, factory_limits);
|
||||
|
@ -1836,7 +1836,7 @@ void recruitment_aspect::recalculate() const {
|
|||
this->valid_ = true;
|
||||
}
|
||||
|
||||
void recruitment_aspect::create_job(std::vector<std::shared_ptr<recruit_job> > &jobs, const config &job) {
|
||||
void recruitment_aspect::create_job(std::vector<std::shared_ptr<recruit_job>> &jobs, const config &job) {
|
||||
std::shared_ptr<recruit_job> job_ptr(new recruit_job(
|
||||
utils::split(job["type"]),
|
||||
job["leader_id"], job["id"],
|
||||
|
@ -1848,7 +1848,7 @@ void recruitment_aspect::create_job(std::vector<std::shared_ptr<recruit_job> > &
|
|||
jobs.push_back(job_ptr);
|
||||
}
|
||||
|
||||
void recruitment_aspect::create_limit(std::vector<std::shared_ptr<recruit_limit> > &limits, const config &lim) {
|
||||
void recruitment_aspect::create_limit(std::vector<std::shared_ptr<recruit_limit>> &limits, const config &lim) {
|
||||
std::shared_ptr<recruit_limit> lim_ptr(new recruit_limit(
|
||||
utils::split(lim["type"]),
|
||||
lim["id"],
|
||||
|
|
|
@ -157,16 +157,16 @@ struct recruit_limit : public component {
|
|||
};
|
||||
|
||||
class recruitment_aspect : public standard_aspect<config> {
|
||||
std::vector<std::shared_ptr<recruit_job> > jobs_;
|
||||
std::vector<std::shared_ptr<recruit_limit> > limits_;
|
||||
std::vector<std::shared_ptr<recruit_job>> jobs_;
|
||||
std::vector<std::shared_ptr<recruit_limit>> limits_;
|
||||
public:
|
||||
recruitment_aspect(readonly_context &context, const config &cfg, const std::string &id);
|
||||
void recalculate() const;
|
||||
void create_job(std::vector<std::shared_ptr<recruit_job> > &jobs, const config &job);
|
||||
void create_limit(std::vector<std::shared_ptr<recruit_limit> > &limits, const config &lim);
|
||||
void create_job(std::vector<std::shared_ptr<recruit_job>> &jobs, const config &job);
|
||||
void create_limit(std::vector<std::shared_ptr<recruit_limit>> &limits, const config &lim);
|
||||
};
|
||||
|
||||
typedef std::map<std::string, std::set<cached_combat_value> > table_row;
|
||||
typedef std::map<std::string, std::set<cached_combat_value>> table_row;
|
||||
typedef std::map<std::string, table_row> cache_table;
|
||||
|
||||
class recruitment : public candidate_action {
|
||||
|
|
|
@ -424,7 +424,7 @@ variant formula_ai::get_value(const std::string& key) const
|
|||
} else if(key == "recruits_of_side")
|
||||
{
|
||||
std::vector<variant> vars;
|
||||
std::vector< std::vector< variant> > tmp;
|
||||
std::vector< std::vector< variant>> tmp;
|
||||
|
||||
unit_types.build_all(unit_type::FULL);
|
||||
|
||||
|
@ -462,7 +462,7 @@ variant formula_ai::get_value(const std::string& key) const
|
|||
} else if(key == "units_of_side")
|
||||
{
|
||||
std::vector<variant> vars;
|
||||
std::vector< std::vector< variant> > tmp;
|
||||
std::vector< std::vector< variant>> tmp;
|
||||
for( size_t i = 0; i<resources::gameboard->teams().size(); ++i)
|
||||
{
|
||||
std::vector<variant> v;
|
||||
|
|
|
@ -86,7 +86,7 @@ engine_fai::~engine_fai()
|
|||
}
|
||||
|
||||
|
||||
void engine_fai::do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b ){
|
||||
void engine_fai::do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b ){
|
||||
wfl::candidate_action_ptr fai_ca = formula_ai_->load_candidate_action_from_config(cfg);
|
||||
if (!fai_ca) {
|
||||
ERR_AI_ENGINE_FAI << "side "<<ai_.get_side()<< " : ERROR creating candidate_action["<<cfg["name"]<<"]"<< std::endl;
|
||||
|
@ -98,7 +98,7 @@ void engine_fai::do_parse_candidate_action_from_config( rca_context &context, co
|
|||
|
||||
}
|
||||
|
||||
void engine_fai::do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b )
|
||||
void engine_fai::do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b )
|
||||
{
|
||||
if (!cfg) {
|
||||
return;
|
||||
|
|
|
@ -33,9 +33,9 @@ public:
|
|||
|
||||
virtual ~engine_fai();
|
||||
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b );
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr >> b );
|
||||
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b );
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr >> b );
|
||||
|
||||
virtual std::string evaluate(const std::string &str);
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ DEFINE_FAI_FUNCTION(calculate_map_ownership, 2, 5)
|
|||
|
||||
size_t number_of_teams = units_input.num_elements();
|
||||
|
||||
std::vector< std::vector<int> > scores( number_of_teams );
|
||||
std::vector< std::vector<int>> scores( number_of_teams );
|
||||
|
||||
for( size_t i = 0; i< number_of_teams; ++i)
|
||||
scores[i].resize(w*h);
|
||||
|
@ -302,7 +302,7 @@ DEFINE_FAI_FUNCTION(calculate_map_ownership, 2, 5)
|
|||
}
|
||||
|
||||
size_t index = 0;
|
||||
for( std::vector< std::vector<int> >::iterator i = scores.begin() ; i != scores.end() ; ++i) {
|
||||
for( std::vector< std::vector<int>>::iterator i = scores.begin() ; i != scores.end() ; ++i) {
|
||||
for( std::vector<int>::iterator j = i->begin() ; j != i->end() ; ++j ) {
|
||||
if(units_input[index].num_elements() != 0) {
|
||||
*j /= units_input[index].num_elements();
|
||||
|
|
|
@ -65,8 +65,8 @@ class typesafe_aspect;
|
|||
|
||||
template<typename T>
|
||||
struct aspect_type {
|
||||
typedef std::shared_ptr< typesafe_aspect<T> > typesafe_ptr;
|
||||
typedef std::vector< std::shared_ptr< typesafe_aspect<T> > > typesafe_ptr_vector;
|
||||
typedef std::shared_ptr< typesafe_aspect<T>> typesafe_ptr;
|
||||
typedef std::vector< std::shared_ptr< typesafe_aspect<T>> > typesafe_ptr_vector;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -74,8 +74,8 @@ class typesafe_known_aspect;
|
|||
|
||||
template<typename T>
|
||||
struct known_aspect_type {
|
||||
typedef std::shared_ptr< typesafe_known_aspect<T> > typesafe_ptr;
|
||||
typedef std::vector< std::shared_ptr< typesafe_known_aspect<T> > > typesafe_ptr_vector;
|
||||
typedef std::shared_ptr< typesafe_known_aspect<T>> typesafe_ptr;
|
||||
typedef std::vector< std::shared_ptr< typesafe_known_aspect<T>> > typesafe_ptr_vector;
|
||||
};
|
||||
|
||||
class action_result;
|
||||
|
|
|
@ -481,7 +481,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
typedef std::map< side_number, std::stack< holder > > AI_map_of_stacks;
|
||||
typedef std::map< side_number, std::stack< holder >> AI_map_of_stacks;
|
||||
|
||||
std::deque< command_history_item > history_;
|
||||
long history_item_counter_;
|
||||
|
|
|
@ -182,150 +182,150 @@ static register_goal_factory<lua_goal>
|
|||
|
||||
//name=composite_aspect
|
||||
|
||||
static register_aspect_factory< composite_aspect< unit_advancements_aspect > >
|
||||
static register_aspect_factory< composite_aspect< unit_advancements_aspect >>
|
||||
advancements__composite_aspect_factory("advancements*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
aggression__composite_aspect_factory("aggression*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<int> >
|
||||
static register_aspect_factory< composite_aspect<int>>
|
||||
attack_depth__composite_aspect_factory("attack_depth*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect< attacks_vector > >
|
||||
static register_aspect_factory< composite_aspect< attacks_vector >>
|
||||
attacks__composite_aspect_factory("attacks*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect< terrain_filter > >
|
||||
static register_aspect_factory< composite_aspect< terrain_filter >>
|
||||
avoid__composite_aspect_factory("avoid*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
caution__composite_aspect_factory("caution*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<std::string> >
|
||||
static register_aspect_factory< composite_aspect<std::string>>
|
||||
grouping__composite_aspect_factory("grouping*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
leader_aggression__composite_aspect_factory("leader_aggression*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<config> >
|
||||
static register_aspect_factory< composite_aspect<config>>
|
||||
leader_goal__composite_aspect_factory("leader_goal*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<bool> >
|
||||
static register_aspect_factory< composite_aspect<bool>>
|
||||
leader_igores_keep__composite_aspect_factory("leader_ignores_keep*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
leader_value__composite_aspect_factory("leader_value*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<bool> >
|
||||
static register_aspect_factory< composite_aspect<bool>>
|
||||
passive_leader__composite_aspect_factory("passive_leader*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<bool> >
|
||||
static register_aspect_factory< composite_aspect<bool>>
|
||||
passive_leader_shares_keep__composite_aspect_factory("passive_leader_shares_keep*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
recruitment_diversity__composite_aspect_factory("recruitment_diversity*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<config> >
|
||||
static register_aspect_factory< composite_aspect<config>>
|
||||
recruitment_instructions__composite_aspect_factory("recruitment_instructions*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< composite_aspect< std::vector<std::string>> >
|
||||
recruitment_more__composite_aspect_factory("recruitment_more*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< composite_aspect< std::vector<std::string>> >
|
||||
recruitment_pattern__composite_aspect_factory("recruitment_pattern*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<int> >
|
||||
static register_aspect_factory< composite_aspect<int>>
|
||||
recruitment_randomness__composite_aspect_factory("recruitment_randomness*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<config> >
|
||||
static register_aspect_factory< composite_aspect<config>>
|
||||
recruitment_save_gold__composite_aspect_factory("recruitment_save_gold*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
scout_village_targeting__composite_aspect_factory("scout_village_targeting*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<bool> >
|
||||
static register_aspect_factory< composite_aspect<bool>>
|
||||
simple_targeting__composite_aspect_factory("simple_targeting*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<bool> >
|
||||
static register_aspect_factory< composite_aspect<bool>>
|
||||
support_villages__composite_aspect_factory("support_villages*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<double> >
|
||||
static register_aspect_factory< composite_aspect<double>>
|
||||
village_value__composite_aspect_factory("village_value*composite_aspect");
|
||||
|
||||
static register_aspect_factory< composite_aspect<int> >
|
||||
static register_aspect_factory< composite_aspect<int>>
|
||||
villages_per_scout__composite_aspect_factory("villages_per_scout*composite_aspect");
|
||||
|
||||
|
||||
//name=standard_aspect
|
||||
static register_aspect_factory< standard_aspect< unit_advancements_aspect > >
|
||||
static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
|
||||
advancements__standard_aspect_factory("advancements*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
aggression__standard_aspect_factory("aggression*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
attack_depth__standard_aspect_factory("attack_depth*standard_aspect");
|
||||
|
||||
static register_aspect_factory< ai_default_rca::aspect_attacks >
|
||||
attacks__testing_ai_default_aspect_attacks_factory("attacks*ai_default_rca::aspect_attacks");
|
||||
|
||||
static register_aspect_factory< standard_aspect< terrain_filter > >
|
||||
static register_aspect_factory< standard_aspect< terrain_filter >>
|
||||
avoid__standard_aspect_factory("avoid*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
caution__standard_aspect_factory("caution*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<std::string> >
|
||||
static register_aspect_factory< standard_aspect<std::string>>
|
||||
grouping__standard_aspect_factory("grouping*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
leader_aggression__standard_aspect_factory("leader_aggression*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<config> >
|
||||
static register_aspect_factory< standard_aspect<config>>
|
||||
leader_goal__standard_aspect_factory("leader_goal*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
leader_ignores_keep__standard_aspect_factory("leader_ignores_keep*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
leader_value__standard_aspect_factory("leader_value*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
passive_leader__standard_aspect_factory("passive_leader*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
passive_leader_shares_keep__standard_aspect_factory("passive_leader_shares_keep*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
recruitment_diversity__standard_aspect_factory("recruitment_diversity*standard_aspect");
|
||||
|
||||
static register_aspect_factory< default_recruitment::recruitment_aspect >
|
||||
recruitment_instructions__standard_aspect_factory("recruitment_instructions*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string>> >
|
||||
recruitment_more__standard_aspect_factory("recruitment_more*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string>> >
|
||||
recruitment_pattern__standard_aspect_factory("recruitment_pattern*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
recruitment_randomness__standard_aspect_factory("recruitment_randomness*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<config> >
|
||||
static register_aspect_factory< standard_aspect<config>>
|
||||
recruitment_save_gold__standard_aspect_factory("recruitment_save_gold*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
scout_village_targeting__standard_aspect_factory("scout_village_targeting*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
simple_targeting__standard_aspect_factory("simple_targeting*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
support_villages__standard_aspect_factory("support_villages*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
village_value__standard_aspect_factory("village_value*standard_aspect");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
villages_per_scout__standard_aspect_factory("villages_per_scout*standard_aspect");
|
||||
|
||||
|
||||
|
@ -334,141 +334,141 @@ static register_aspect_factory< ai_default_rca::aspect_attacks >
|
|||
old_attacks__testing_ai_default_aspect_attacks_factory("attacks*testing_ai_default::aspect_attacks");
|
||||
|
||||
//name = default
|
||||
static register_aspect_factory< standard_aspect< unit_advancements_aspect > >
|
||||
static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
|
||||
advancements__standard_aspect_factory2("advancements*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
aggression__standard_aspect_factory2("aggression*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
attack_depth__standard_aspect_factory2("attack_depth*");
|
||||
|
||||
static register_aspect_factory< ai_default_rca::aspect_attacks >
|
||||
attacks__testing_ai_default_aspect_attacks_factory2("attacks*");
|
||||
|
||||
static register_aspect_factory< standard_aspect< terrain_filter > >
|
||||
static register_aspect_factory< standard_aspect< terrain_filter >>
|
||||
avoid__standard_aspect_factory2("avoid*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
caution__standard_aspect_factory2("caution*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<std::string> >
|
||||
static register_aspect_factory< standard_aspect<std::string>>
|
||||
grouping__standard_aspect_factory2("grouping*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
leader_aggression__standard_aspect_factory2("leader_aggression*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<config> >
|
||||
static register_aspect_factory< standard_aspect<config>>
|
||||
leader_goal__standard_aspect_factory2("leader_goal*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
leader_ignores_keep__standard_aspect_factory2("leader_ignores_keep*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
leader_value__standard_aspect_factory2("leader_value*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
passive_leader__standard_aspect_factory2("passive_leader*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
passive_leader_shares_keep__standard_aspect_factory2("passive_leader_shares_keep*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
recruitment_diversity__standard_aspect_factory2("recruitment_diversity*");
|
||||
|
||||
static register_aspect_factory< default_recruitment::recruitment_aspect >
|
||||
recruitment_instructions__standard_aspect_factory2("recruitment_instructions*");
|
||||
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string>> >
|
||||
recruitment_more__standard_aspect_factory2("recruitment_more*");
|
||||
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string> > >
|
||||
static register_aspect_factory< standard_aspect< std::vector<std::string>> >
|
||||
recruitment_pattern__standard_aspect_factory2("recruitment_pattern*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
recruitment_randomness__standard_aspect_factory2("recruitment_randomness*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<config> >
|
||||
static register_aspect_factory< standard_aspect<config>>
|
||||
recruitment_save_gold__standard_aspect_factory2("recruitment_save_gold*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
scout_village_targeting__standard_aspect_factory2("scout_village_targeting*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
simple_targeting__standard_aspect_factory2("simple_targeting*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<bool> >
|
||||
static register_aspect_factory< standard_aspect<bool>>
|
||||
support_villages__standard_aspect_factory2("support_villages*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<double> >
|
||||
static register_aspect_factory< standard_aspect<double>>
|
||||
village_value__standard_aspect_factory2("village_value*");
|
||||
|
||||
static register_aspect_factory< standard_aspect<int> >
|
||||
static register_aspect_factory< standard_aspect<int>>
|
||||
villages_per_scout__standard_aspect_factory2("villages_per_scout*");
|
||||
|
||||
|
||||
//name = lua
|
||||
static register_lua_aspect_factory< lua_aspect< unit_advancements_aspect > >
|
||||
static register_lua_aspect_factory< lua_aspect< unit_advancements_aspect >>
|
||||
advancements__lua_aspect_factory("advancements*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
aggression__lua_aspect_factory("aggression*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<int> >
|
||||
static register_lua_aspect_factory< lua_aspect<int>>
|
||||
attack_depth__lua_aspect_factory("attack_depth*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< aspect_attacks_lua >
|
||||
attacks__lua_aspect_factory("attacks*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<terrain_filter> >
|
||||
static register_lua_aspect_factory< lua_aspect<terrain_filter>>
|
||||
avoid__lua_aspect_factory("avoid*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
caution__lua_aspect_factory("caution*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<std::string> >
|
||||
static register_lua_aspect_factory< lua_aspect<std::string>>
|
||||
grouping__lua_aspect_factory("grouping*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
leader_aggression__lua_aspect_factory("leader_aggression*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<config> >
|
||||
static register_lua_aspect_factory< lua_aspect<config>>
|
||||
leader_goal__lua_aspect_factory("leader_goal*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<bool> >
|
||||
static register_lua_aspect_factory< lua_aspect<bool>>
|
||||
leader_ignores_keep__lua_aspect_factory("leader_ignores_keep*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
leader_value__lua_aspect_factory("leader_value*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<bool> >
|
||||
static register_lua_aspect_factory< lua_aspect<bool>>
|
||||
passive_leader__lua_aspect_factory("passive_leader*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<bool> >
|
||||
static register_lua_aspect_factory< lua_aspect<bool>>
|
||||
passive_leader_shares_keep__lua_aspect_factory("passive_leader_shares_keep*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
scout_village_targeting__lua_aspect_factory("scout_village_targeting*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<bool> >
|
||||
static register_lua_aspect_factory< lua_aspect<bool>>
|
||||
simple_targeting__lua_aspect_factory("simple_targeting*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<bool> >
|
||||
static register_lua_aspect_factory< lua_aspect<bool>>
|
||||
support_villages__lua_aspect_factory("support_villages*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<double> >
|
||||
static register_lua_aspect_factory< lua_aspect<double>>
|
||||
village_value__lua_aspect_factory("village_value*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect<int> >
|
||||
static register_lua_aspect_factory< lua_aspect<int>>
|
||||
villages_per_scout__lua_aspect_factory("villages_per_scout*lua_aspect");
|
||||
|
||||
static register_lua_aspect_factory< lua_aspect< std::vector<std::string> > >
|
||||
static register_lua_aspect_factory< lua_aspect< std::vector<std::string>> >
|
||||
recruitment_pattern__lua_aspect_factory("recruitment_pattern*lua_aspect");
|
||||
|
||||
|
||||
// Some compatibility - recruitment is a removed aspect, but its syntax
|
||||
// is compatible with recruitment_instructions
|
||||
static register_aspect_factory< composite_aspect<config> >
|
||||
static register_aspect_factory< composite_aspect<config>>
|
||||
recruitments__composite_aspect_factory("recruitment*composite_aspect");
|
||||
|
||||
static register_aspect_factory< default_recruitment::recruitment_aspect >
|
||||
|
|
|
@ -63,7 +63,7 @@ template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const
|
|||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template< int I > struct is_placeholder< arg<I> >
|
||||
template< int I > struct is_placeholder< arg<I>>
|
||||
{
|
||||
enum _vt { value = I };
|
||||
};
|
||||
|
|
|
@ -80,7 +80,7 @@ std::string generate_salt(size_t len)
|
|||
boost::mt19937 mt(time(0));
|
||||
std::string salt = std::string(len, '0');
|
||||
boost::uniform_int<> from_str(0, itoa64.length() - 1);
|
||||
boost::variate_generator< boost::mt19937, boost::uniform_int<> > get_char(mt, from_str);
|
||||
boost::variate_generator< boost::mt19937, boost::uniform_int<>> get_char(mt, from_str);
|
||||
|
||||
for(size_t i = 0; i < len; i++) {
|
||||
salt[i] = itoa64[get_char()];
|
||||
|
|
|
@ -233,18 +233,18 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
|
|||
po::options_description multiplayer_opts("Multiplayer options");
|
||||
multiplayer_opts.add_options()
|
||||
("multiplayer,m", "Starts a multiplayer game. There are additional options that can be used as explained below:")
|
||||
("ai-config", po::value<std::vector<std::string> >()->composing(), "selects a configuration file to load for this side. <arg> should have format side:value")
|
||||
("algorithm", po::value<std::vector<std::string> >()->composing(), "selects a non-standard algorithm to be used by the AI controller for this side. <arg> should have format side:value")
|
||||
("controller", po::value<std::vector<std::string> >()->composing(), "selects the controller for this side. <arg> should have format side:value")
|
||||
("ai-config", po::value<std::vector<std::string>>()->composing(), "selects a configuration file to load for this side. <arg> should have format side:value")
|
||||
("algorithm", po::value<std::vector<std::string>>()->composing(), "selects a non-standard algorithm to be used by the AI controller for this side. <arg> should have format side:value")
|
||||
("controller", po::value<std::vector<std::string>>()->composing(), "selects the controller for this side. <arg> should have format side:value")
|
||||
("era", po::value<std::string>(), "selects the era to be played in by its id.")
|
||||
("exit-at-end", "exit Wesnoth at the end of the scenario.")
|
||||
("ignore-map-settings", "do not use map settings.")
|
||||
("label", po::value<std::string>(), "sets the label for AIs.") //TODO is the description precise? this option was undocumented before.
|
||||
("multiplayer-repeat", po::value<unsigned int>(), "repeats a multiplayer game after it is finished <arg> times.")
|
||||
("nogui", "runs the game without the GUI.")
|
||||
("parm", po::value<std::vector<std::string> >()->composing(), "sets additional parameters for this side. <arg> should have format side:name:value.")
|
||||
("parm", po::value<std::vector<std::string>>()->composing(), "sets additional parameters for this side. <arg> should have format side:name:value.")
|
||||
("scenario", po::value<std::string>(), "selects a multiplayer scenario. The default scenario is \"multiplayer_The_Freelands\".")
|
||||
("side", po::value<std::vector<std::string> >()->composing(), "selects a faction of the current era for this side by id. <arg> should have format side:value.")
|
||||
("side", po::value<std::vector<std::string>>()->composing(), "selects a faction of the current era for this side by id. <arg> should have format side:value.")
|
||||
("turns", po::value<std::string>(), "sets the number of turns. The default is \"50\".")
|
||||
;
|
||||
|
||||
|
@ -291,9 +291,9 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
|
|||
po::store(po::command_line_parser(args_).options(all_).positional(positional).style(parsing_style).run(),vm);
|
||||
|
||||
if (vm.count("ai-config"))
|
||||
multiplayer_ai_config = parse_to_uint_string_tuples_(vm["ai-config"].as<std::vector<std::string> >());
|
||||
multiplayer_ai_config = parse_to_uint_string_tuples_(vm["ai-config"].as<std::vector<std::string>>());
|
||||
if (vm.count("algorithm"))
|
||||
multiplayer_algorithm = parse_to_uint_string_tuples_(vm["algorithm"].as<std::vector<std::string> >());
|
||||
multiplayer_algorithm = parse_to_uint_string_tuples_(vm["algorithm"].as<std::vector<std::string>>());
|
||||
if (vm.count("bunzip2"))
|
||||
bunzip2 = vm["bunzip2"].as<std::string>();
|
||||
if (vm.count("bzip2"))
|
||||
|
@ -313,7 +313,7 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
|
|||
if (vm.count("config-path"))
|
||||
userdata_path = true; //TODO: complain and remove
|
||||
if (vm.count("controller"))
|
||||
multiplayer_controller = parse_to_uint_string_tuples_(vm["controller"].as<std::vector<std::string> >());
|
||||
multiplayer_controller = parse_to_uint_string_tuples_(vm["controller"].as<std::vector<std::string>>());
|
||||
if (vm.count("data-dir"))
|
||||
data_dir = vm["data-dir"].as<std::string>();
|
||||
if (vm.count("data-path"))
|
||||
|
@ -393,7 +393,7 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
|
|||
if (vm.count("nogui"))
|
||||
nogui = true;
|
||||
if (vm.count("parm"))
|
||||
multiplayer_parm = parse_to_uint_string_string_tuples_(vm["parm"].as<std::vector<std::string> >());
|
||||
multiplayer_parm = parse_to_uint_string_string_tuples_(vm["parm"].as<std::vector<std::string>>());
|
||||
if (vm.count("path"))
|
||||
path = true;
|
||||
if (vm.count("preprocess"))
|
||||
|
@ -440,7 +440,7 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
|
|||
if (vm.count("report"))
|
||||
report = true;
|
||||
if (vm.count("side"))
|
||||
multiplayer_side = parse_to_uint_string_tuples_(vm["side"].as<std::vector<std::string> >());
|
||||
multiplayer_side = parse_to_uint_string_tuples_(vm["side"].as<std::vector<std::string>>());
|
||||
if (vm.count("test"))
|
||||
test = vm["test"].as<std::string>();
|
||||
if (vm.count("unit"))
|
||||
|
@ -482,7 +482,7 @@ void commandline_options::parse_log_domains_(const std::string &domains_string,
|
|||
for (const std::string& domain : domains)
|
||||
{
|
||||
if (!log)
|
||||
log = std::vector<std::pair<int, std::string> >();
|
||||
log = std::vector<std::pair<int, std::string>>();
|
||||
log->emplace_back(severity, domain);
|
||||
}
|
||||
}
|
||||
|
@ -518,9 +518,9 @@ void commandline_options::parse_resolution_ ( const std::string& resolution_stri
|
|||
resolution = std::make_pair(xres, yres);
|
||||
}
|
||||
|
||||
std::vector<std::pair<unsigned int,std::string> > commandline_options::parse_to_uint_string_tuples_(const std::vector<std::string> &strings, char separator)
|
||||
std::vector<std::pair<unsigned int,std::string>> commandline_options::parse_to_uint_string_tuples_(const std::vector<std::string> &strings, char separator)
|
||||
{
|
||||
std::vector<std::pair<unsigned int,std::string> > vec;
|
||||
std::vector<std::pair<unsigned int,std::string>> vec;
|
||||
const std::string& expected_format
|
||||
= std::string() + "UINT" + separator + "STRING";
|
||||
|
||||
|
@ -543,9 +543,9 @@ std::vector<std::pair<unsigned int,std::string> > commandline_options::parse_to_
|
|||
return vec;
|
||||
}
|
||||
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string> > commandline_options::parse_to_uint_string_string_tuples_(const std::vector<std::string> &strings, char separator)
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string>> commandline_options::parse_to_uint_string_string_tuples_(const std::vector<std::string> &strings, char separator)
|
||||
{
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string> > vec;
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string>> vec;
|
||||
const std::string& expected_format
|
||||
= std::string() + "UINT" + separator + "STRING" + separator + "STRING";
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
boost::optional<std::string> language;
|
||||
/// Contains parsed arguments of --log-* (e.g. --log-debug).
|
||||
/// Vector of pairs (severity, log domain).
|
||||
boost::optional<std::vector<std::pair<int, std::string> > > log;
|
||||
boost::optional<std::vector<std::pair<int, std::string>> > log;
|
||||
/// Non-empty if --log-strict was given
|
||||
boost::optional<int> log_strict_level;
|
||||
/// Non-empty if --load was given on the command line. Savegame specified to load after start.
|
||||
|
@ -102,11 +102,11 @@ public:
|
|||
/// True if --multiplayer was given on the command line. Goes directly into multiplayer mode.
|
||||
bool multiplayer;
|
||||
/// Non-empty if --ai-config was given on the command line. Vector of pairs (side number, value). Dependent on --multiplayer.
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string> > > multiplayer_ai_config;
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string>> > multiplayer_ai_config;
|
||||
/// Non-empty if --algorithm was given on the command line. Vector of pairs (side number, value). Dependent on --multiplayer.
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string> > > multiplayer_algorithm;
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string>> > multiplayer_algorithm;
|
||||
/// Non-empty if --controller was given on the command line. Vector of pairs (side number, controller). Dependent on --multiplayer.
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string> > > multiplayer_controller;
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string>> > multiplayer_controller;
|
||||
/// Non-empty if --era was given on the command line. Dependent on --multiplayer.
|
||||
boost::optional<std::string> multiplayer_era;
|
||||
/// True if --exit-at-and was given on the command line. Dependent on --multiplayer.
|
||||
|
@ -116,13 +116,13 @@ public:
|
|||
/// Non-empty if --label was given on the command line. Dependent on --multiplayer.
|
||||
boost::optional<std::string> multiplayer_label;
|
||||
/// Non-empty if --parm was given on the command line. Vector of pairs (side number, parm name, parm value). Dependent on --multiplayer.
|
||||
boost::optional<std::vector<std::tuple<unsigned int, std::string, std::string> > > multiplayer_parm;
|
||||
boost::optional<std::vector<std::tuple<unsigned int, std::string, std::string>> > multiplayer_parm;
|
||||
/// Repeats specified by --multiplayer-repeat option. Repeats a multiplayer game after it is finished. Dependent on --multiplayer.
|
||||
boost::optional<unsigned int> multiplayer_repeat;
|
||||
/// Non-empty if --scenario was given on the command line. Dependent on --multiplayer.
|
||||
boost::optional<std::string> multiplayer_scenario;
|
||||
/// Non-empty if --side was given on the command line. Vector of pairs (side number, faction id). Dependent on --multiplayer.
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string> > > multiplayer_side;
|
||||
boost::optional<std::vector<std::pair<unsigned int, std::string>> > multiplayer_side;
|
||||
/// Non-empty if --turns was given on the command line. Dependent on --multiplayer.
|
||||
boost::optional<std::string> multiplayer_turns;
|
||||
/// Max FPS specified by --max-fps option.
|
||||
|
@ -146,7 +146,7 @@ public:
|
|||
/// True if --preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode.
|
||||
bool preprocess;
|
||||
/// Defines that were given to the --preprocess option.
|
||||
boost::optional<std::vector<std::string> > preprocess_defines;
|
||||
boost::optional<std::vector<std::string>> preprocess_defines;
|
||||
/// Non-empty if --preprocess-input-macros was given on the command line. Specifies a file that contains [preproc_define]s to be included before preprocessing. Dependent on --preprocess.
|
||||
boost::optional<std::string> preprocess_input_macros;
|
||||
/// Non-empty if --preprocess-output-macros was given on the command line. Outputs all preprocessed macros to the specified file. Dependent on --preprocess.
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
/// Target (output) path that was given to the --preprocess option.
|
||||
boost::optional<std::string> preprocess_target;
|
||||
/// Pair of AxB values specified after --resolution. Changes Wesnoth resolution.
|
||||
boost::optional<std::pair<int,int> > resolution;
|
||||
boost::optional<std::pair<int,int>> resolution;
|
||||
/// RNG seed specified by --rng-seed option. Initializes RNG with given seed.
|
||||
boost::optional<unsigned int> rng_seed;
|
||||
/// Non-empty if --server was given on the command line. Connects Wesnoth to specified server. If no server was specified afterwards, contains an empty string.
|
||||
|
@ -218,9 +218,9 @@ private:
|
|||
void parse_log_strictness (const std::string &severity);
|
||||
void parse_resolution_ (const std::string &resolution_string);
|
||||
/// A helper function splitting vector of strings of format unsigned int:string to vector of tuples (unsigned int,string)
|
||||
std::vector<std::pair<unsigned int,std::string> > parse_to_uint_string_tuples_(const std::vector<std::string> &strings, char separator = ':');
|
||||
std::vector<std::pair<unsigned int,std::string>> parse_to_uint_string_tuples_(const std::vector<std::string> &strings, char separator = ':');
|
||||
/// A helper function splitting vector of strings of format unsigned int:string:string to vector of tuples (unsigned int,string,string)
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string> > parse_to_uint_string_string_tuples_(const std::vector<std::string> &strings, char separator = ':');
|
||||
std::vector<std::tuple<unsigned int,std::string,std::string>> parse_to_uint_string_string_tuples_(const std::vector<std::string> &strings, char separator = ':');
|
||||
std::vector<std::string> args_;
|
||||
std::string args0_;
|
||||
boost::program_options::options_description all_;
|
||||
|
|
|
@ -68,9 +68,9 @@ typedef boost::multi_index_container<
|
|||
wnotify,
|
||||
indexed_by<
|
||||
//hashed by ids
|
||||
hashed_unique<tag<by_id>, member<wnotify,const uint32_t,&wnotify::id> >,
|
||||
hashed_unique<tag<by_id>, member<wnotify,const uint32_t,&wnotify::id>>,
|
||||
//hashed by owners
|
||||
hashed_unique<tag<by_owner>, member<wnotify,const std::string,&wnotify::owner> >
|
||||
hashed_unique<tag<by_owner>, member<wnotify,const std::string,&wnotify::owner>>
|
||||
>
|
||||
> wnotify_set;
|
||||
|
||||
|
|
|
@ -795,7 +795,7 @@ private:
|
|||
surface get_flag(const map_location& loc);
|
||||
|
||||
/** Animated flags for each team */
|
||||
std::vector<animated<image::locator> > flags_;
|
||||
std::vector<animated<image::locator>> flags_;
|
||||
|
||||
// This vector is a class member to avoid repeated memory allocations in get_terrain_images(),
|
||||
// which turned out to be a significant bottleneck while profiling.
|
||||
|
@ -1041,7 +1041,7 @@ private:
|
|||
|
||||
surface map_screenshot_surf_;
|
||||
|
||||
std::vector<std::function<void(display&)> > redraw_observers_;
|
||||
std::vector<std::function<void(display&)>> redraw_observers_;
|
||||
|
||||
/** Debug flag - overlay x,y coords on tiles */
|
||||
bool draw_coordinates_;
|
||||
|
|
|
@ -700,7 +700,7 @@ bool editor_controller::execute_command(const hotkey::hotkey_command& cmd, int i
|
|||
case HOTKEY_EDITOR_PALETTE_GROUPS:
|
||||
{
|
||||
//TODO this code waits for the gui2 dialog to get ready
|
||||
// std::vector< std::pair< std::string, std::string > > blah_items;
|
||||
// std::vector< std::pair< std::string, std::string >> blah_items;
|
||||
// toolkit_->get_palette_manager()->active_palette().expand_palette_groups_menu(blah_items);
|
||||
// int selected = 1; //toolkit_->get_palette_manager()->active_palette().get_selected;
|
||||
// gui2::teditor_select_palette_group::execute(selected, blah_items, gui_->video());
|
||||
|
|
|
@ -240,7 +240,7 @@ class editor_controller : public controller_base,
|
|||
const std::unique_ptr<editor_display> gui_;
|
||||
|
||||
/** Pre-defined time of day lighting settings for the settings dialog */
|
||||
typedef std::map<std::string, std::pair<std::string ,std::vector<time_of_day> > > tods_map;
|
||||
typedef std::map<std::string, std::pair<std::string ,std::vector<time_of_day>> > tods_map;
|
||||
tods_map tods_;
|
||||
|
||||
/* managers */
|
||||
|
|
|
@ -166,7 +166,7 @@ private:
|
|||
unsigned int palette_x_;
|
||||
|
||||
protected:
|
||||
std::map<std::string, std::vector<std::string> > group_map_;
|
||||
std::map<std::string, std::vector<std::string>> group_map_;
|
||||
|
||||
typedef std::map<std::string, Item> item_map;
|
||||
item_map item_map_;
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
std::shared_ptr<mouse_action> mouse_action_; // Never null (outside the constructor).
|
||||
|
||||
/** The mouse actions */
|
||||
typedef std::map<hotkey::HOTKEY_COMMAND, std::shared_ptr<mouse_action> > mouse_action_map;
|
||||
typedef std::map<hotkey::HOTKEY_COMMAND, std::shared_ptr<mouse_action>> mouse_action_map;
|
||||
mouse_action_map mouse_actions_;
|
||||
|
||||
//Brush members
|
||||
|
|
|
@ -1077,7 +1077,7 @@ namespace {
|
|||
|
||||
std::set<std::string> binary_paths;
|
||||
|
||||
typedef std::map<std::string,std::vector<std::string> > paths_map;
|
||||
typedef std::map<std::string,std::vector<std::string>> paths_map;
|
||||
paths_map binary_paths_cache;
|
||||
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ static char_block_map char_blocks;
|
|||
typedef std::map<std::string,SDL_Rect> line_size_cache_map;
|
||||
|
||||
//map of styles -> sizes -> cache
|
||||
static std::map<int,std::map<int,line_size_cache_map> > line_size_cache;
|
||||
static std::map<int,std::map<int,line_size_cache_map>> line_size_cache;
|
||||
|
||||
typedef std::map<std::pair<std::string, int>, TTF_Font*> open_font_cache;
|
||||
open_font_cache open_fonts;
|
||||
|
@ -264,7 +264,7 @@ static surface render_text(const std::string& text, int fontsize, const color_t&
|
|||
{
|
||||
// we keep blank lines and spaces (may be wanted for indentation)
|
||||
const std::vector<std::string> lines = utils::split(text, '\n', 0);
|
||||
std::vector<std::vector<surface> > surfaces;
|
||||
std::vector<std::vector<surface>> surfaces;
|
||||
surfaces.reserve(lines.size());
|
||||
size_t width = 0, height = 0;
|
||||
|
||||
|
@ -310,7 +310,7 @@ static surface render_text(const std::string& text, int fontsize, const color_t&
|
|||
return res;
|
||||
|
||||
size_t ypos = 0;
|
||||
for(std::vector< std::vector<surface> >::iterator i = surfaces.begin(),
|
||||
for(std::vector< std::vector<surface>>::iterator i = surfaces.begin(),
|
||||
i_end = surfaces.end(); i != i_end; ++i) {
|
||||
size_t xpos = 0;
|
||||
height = 0;
|
||||
|
|
|
@ -446,7 +446,7 @@ variant config_callable::get_value(const std::string& key) const
|
|||
|
||||
return variant(result);
|
||||
} else if(key == "__children") {
|
||||
std::map<std::string, std::vector<variant> > build;
|
||||
std::map<std::string, std::vector<variant>> build;
|
||||
for(const auto& child : cfg_.all_children_range()) {
|
||||
const variant cfg_child(std::make_shared<config_callable>(child.cfg));
|
||||
build[child.key].push_back(cfg_child);
|
||||
|
|
|
@ -406,7 +406,7 @@ WML_HANDLER_FUNCTION(move_units_fake,, cfg)
|
|||
size_t num_units = unit_cfgs.size();
|
||||
std::vector<fake_unit_ptr > units;
|
||||
units.reserve(num_units);
|
||||
std::vector<std::vector<map_location> > paths;
|
||||
std::vector<std::vector<map_location>> paths;
|
||||
paths.reserve(num_units);
|
||||
|
||||
LOG_NG << "Moving " << num_units << " units\n";
|
||||
|
|
|
@ -42,14 +42,14 @@ static lg::log_domain log_engine("engine");
|
|||
namespace game_events {
|
||||
|
||||
namespace builtin_conditions {
|
||||
std::vector<std::pair<int,int> > default_counts = utils::parse_ranges("1-99999");
|
||||
std::vector<std::pair<int,int>> default_counts = utils::parse_ranges("1-99999");
|
||||
|
||||
bool have_unit(const vconfig& cfg)
|
||||
{
|
||||
if(!resources::gameboard) {
|
||||
return false;
|
||||
}
|
||||
std::vector<std::pair<int,int> > counts = cfg.has_attribute("count")
|
||||
std::vector<std::pair<int,int>> counts = cfg.has_attribute("count")
|
||||
? utils::parse_ranges(cfg["count"]) : default_counts;
|
||||
int match_count = 0;
|
||||
const unit_filter ufilt(cfg);
|
||||
|
@ -86,7 +86,7 @@ namespace builtin_conditions {
|
|||
std::set<map_location> res;
|
||||
terrain_filter(cfg, resources::filter_con).get_locations(res);
|
||||
|
||||
std::vector<std::pair<int,int> > counts = cfg.has_attribute("count")
|
||||
std::vector<std::pair<int,int>> counts = cfg.has_attribute("count")
|
||||
? utils::parse_ranges(cfg["count"]) : default_counts;
|
||||
return in_ranges<int>(res.size(), counts);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ static lg::log_domain log_mapgen("mapgen");
|
|||
#define ERR_NG LOG_STREAM(err, log_mapgen)
|
||||
#define LOG_NG LOG_STREAM(info, log_mapgen)
|
||||
|
||||
typedef std::vector<std::vector<int> > height_map;
|
||||
typedef std::vector<std::vector<int>> height_map;
|
||||
typedef t_translation::ter_map terrain_map;
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
std::string default_generate_map(generator_data data, std::map<map_location,std::string>* labels, const config& cfg);
|
||||
|
||||
private:
|
||||
typedef std::vector<std::vector<int> > height_map;
|
||||
typedef std::vector<std::vector<int>> height_map;
|
||||
typedef t_translation::ter_map terrain_map;
|
||||
|
||||
bool generate_river_internal(const height_map& heights,
|
||||
|
|
|
@ -420,7 +420,7 @@ void set_language(const std::string& language, const std::vector<std::string>* /
|
|||
|
||||
int compare(const std::string& s1, const std::string& s2)
|
||||
{
|
||||
return std::use_facet<std::collate<char> >(get_manager().get_locale()).compare(s1.c_str(), s1.c_str() + s1.size(), s2.c_str(), s2.c_str() + s2.size());
|
||||
return std::use_facet<std::collate<char>>(get_manager().get_locale()).compare(s1.c_str(), s1.c_str() + s1.size(), s2.c_str(), s2.c_str() + s2.size());
|
||||
}
|
||||
|
||||
int icompare(const std::string& s1, const std::string& s2)
|
||||
|
@ -429,7 +429,7 @@ int icompare(const std::string& s1, const std::string& s2)
|
|||
// https://github.com/wesnoth/wesnoth/issues/2094
|
||||
return compare(s1, s2);
|
||||
#else
|
||||
return std::use_facet<bl::collator<char> >(get_manager().get_locale()).compare(
|
||||
return std::use_facet<bl::collator<char>>(get_manager().get_locale()).compare(
|
||||
bl::collator_base::secondary, s1, s2);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -708,7 +708,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
std::map<ui_event, signal_type<T> > queue;
|
||||
std::map<ui_event, signal_type<T>> queue;
|
||||
|
||||
void connect_signal(const ui_event event,
|
||||
const queue_position position,
|
||||
|
|
|
@ -146,7 +146,7 @@ typedef boost::mpl::set<boost::mpl::int_<DRAW>,
|
|||
boost::mpl::int_<RIGHT_BUTTON_DOWN>,
|
||||
boost::mpl::int_<RIGHT_BUTTON_UP>,
|
||||
boost::mpl::int_<RIGHT_BUTTON_CLICK>,
|
||||
boost::mpl::int_<RIGHT_BUTTON_DOUBLE_CLICK> >
|
||||
boost::mpl::int_<RIGHT_BUTTON_DOUBLE_CLICK>>
|
||||
set_event;
|
||||
|
||||
/**
|
||||
|
@ -168,7 +168,7 @@ typedef boost::mpl::set<boost::mpl::int_<SDL_VIDEO_RESIZE>,
|
|||
boost::mpl::int_<SDL_WHEEL_UP>,
|
||||
boost::mpl::int_<SDL_WHEEL_DOWN>,
|
||||
boost::mpl::int_<SDL_WHEEL_LEFT>,
|
||||
boost::mpl::int_<SDL_WHEEL_RIGHT> > set_event_mouse;
|
||||
boost::mpl::int_<SDL_WHEEL_RIGHT>> set_event_mouse;
|
||||
|
||||
/**
|
||||
* Helper for catching use error of dispatcher::connect_signal.
|
||||
|
@ -176,7 +176,7 @@ typedef boost::mpl::set<boost::mpl::int_<SDL_VIDEO_RESIZE>,
|
|||
* This version is for callbacks with the keyboard values (these haven't been
|
||||
* determined yet).
|
||||
*/
|
||||
typedef boost::mpl::set<boost::mpl::int_<SDL_KEY_DOWN> > set_event_keyboard;
|
||||
typedef boost::mpl::set<boost::mpl::int_<SDL_KEY_DOWN>> set_event_keyboard;
|
||||
|
||||
/**
|
||||
* Helper for catching use error of dispatcher::connect_signal.
|
||||
|
@ -185,7 +185,7 @@ typedef boost::mpl::set<boost::mpl::int_<SDL_KEY_DOWN> > set_event_keyboard;
|
|||
*/
|
||||
typedef boost::mpl::set<boost::mpl::int_<SDL_TOUCH_MOTION>,
|
||||
boost::mpl::int_<SDL_TOUCH_UP>,
|
||||
boost::mpl::int_<SDL_TOUCH_DOWN> >
|
||||
boost::mpl::int_<SDL_TOUCH_DOWN>>
|
||||
set_event_touch;
|
||||
|
||||
/**
|
||||
|
@ -201,7 +201,7 @@ typedef boost::mpl::set<boost::mpl::int_<NOTIFY_REMOVAL>,
|
|||
boost::mpl::int_<RECEIVE_KEYBOARD_FOCUS>,
|
||||
boost::mpl::int_<LOSE_KEYBOARD_FOCUS>,
|
||||
boost::mpl::int_<NOTIFY_REMOVE_TOOLTIP>,
|
||||
boost::mpl::int_<SDL_ACTIVATE> >
|
||||
boost::mpl::int_<SDL_ACTIVATE>>
|
||||
set_event_notification;
|
||||
|
||||
/**
|
||||
|
@ -214,7 +214,7 @@ set_event_notification;
|
|||
*/
|
||||
typedef boost::mpl::set<boost::mpl::int_<MESSAGE_SHOW_TOOLTIP>,
|
||||
boost::mpl::int_<MESSAGE_SHOW_HELPTIP>,
|
||||
boost::mpl::int_<REQUEST_PLACEMENT> >
|
||||
boost::mpl::int_<REQUEST_PLACEMENT>>
|
||||
set_event_message;
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ set_event_message;
|
|||
*
|
||||
* This version is for callbacks of raw events.
|
||||
*/
|
||||
typedef boost::mpl::set<boost::mpl::int_<SDL_RAW_EVENT> > set_event_raw_event;
|
||||
typedef boost::mpl::set<boost::mpl::int_<SDL_RAW_EVENT>> set_event_raw_event;
|
||||
|
||||
/**
|
||||
* Helper for catching use error of dispatcher::connect_signal.
|
||||
|
|
|
@ -75,7 +75,7 @@ private:
|
|||
* * first The origin of a column.
|
||||
* * second The width of a column.
|
||||
*/
|
||||
std::vector<std::pair<int, int> > columns_;
|
||||
std::vector<std::pair<int, int>> columns_;
|
||||
|
||||
/** The row to add an item to. */
|
||||
unsigned row_;
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
* * first The origin of a row.
|
||||
* * second The height of a row.
|
||||
*/
|
||||
std::vector<std::pair<int, int> > rows_;
|
||||
std::vector<std::pair<int, int>> rows_;
|
||||
|
||||
/** Holds the widths of the columns. */
|
||||
std::vector<int> columns_;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
private:
|
||||
void set_logger(const std::basic_string<char> log_domain);
|
||||
|
||||
std::map<std::string, group<std::string> > groups_;
|
||||
std::map<std::string, group<std::string>> groups_;
|
||||
std::vector<std::string> domain_list_, widget_id_;
|
||||
|
||||
/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
|
||||
|
|
|
@ -40,7 +40,7 @@ private:
|
|||
void handle_reset_click(window& window);
|
||||
|
||||
bool show_unmoved_, show_partial_, show_moved_, show_ally_, show_enemy_;
|
||||
std::map<std::string, group<std::string> > groups_;
|
||||
std::map<std::string, group<std::string>> groups_;
|
||||
|
||||
/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
|
||||
virtual const std::string& window_id() const override;
|
||||
|
|
|
@ -242,7 +242,7 @@ public:
|
|||
virtual void create_items(
|
||||
const int index,
|
||||
builder_grid_const_ptr list_builder,
|
||||
const std::vector<std::map<std::string /*widget id*/, string_map> >&
|
||||
const std::vector<std::map<std::string /*widget id*/, string_map>>&
|
||||
data,
|
||||
const std::function<void(widget&)>& callback) = 0;
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ static void shrink_cache()
|
|||
DBG_GUI_D << "Shrinking the minimap cache.\n";
|
||||
#endif
|
||||
|
||||
std::vector<std::pair<unsigned, tcache::iterator> > items;
|
||||
std::vector<std::pair<unsigned, tcache::iterator>> items;
|
||||
for(tcache::iterator itor = cache.begin(); itor != cache.end(); ++itor) {
|
||||
|
||||
itor->second.age /= 2;
|
||||
|
@ -159,7 +159,7 @@ static void shrink_cache()
|
|||
items.end(),
|
||||
compare);
|
||||
|
||||
for(std::vector<std::pair<unsigned, tcache::iterator> >::iterator vitor
|
||||
for(std::vector<std::pair<unsigned, tcache::iterator>>::iterator vitor
|
||||
= items.begin();
|
||||
vitor < items.begin() + cache_max_size / 4;
|
||||
++vitor) {
|
||||
|
|
|
@ -247,7 +247,7 @@ struct builder_multi_page : public builder_styled_widget
|
|||
* Contains a vector with the data to set in every cell, it's used to
|
||||
* serialize the data in the config, so the config is no longer required.
|
||||
*/
|
||||
std::vector<std::map<std::string, t_string> > data;
|
||||
std::vector<std::map<std::string, t_string>> data;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
|
|
|
@ -672,7 +672,7 @@ private:
|
|||
* When drawing only the widgets that are dirty are updated. The draw()
|
||||
* function has more information about the dirty_list_.
|
||||
*/
|
||||
std::vector<std::vector<widget*> > dirty_list_;
|
||||
std::vector<std::vector<widget*>> dirty_list_;
|
||||
|
||||
/**
|
||||
* In how many consecutive frames the window has changed. This is used to
|
||||
|
|
|
@ -395,7 +395,7 @@ std::vector<topic> generate_weapon_special_topics(const bool sort_generated)
|
|||
std::vector<topic> topics;
|
||||
|
||||
std::map<t_string, std::string> special_description;
|
||||
std::map<t_string, std::set<std::string, string_less> > special_units;
|
||||
std::map<t_string, std::set<std::string, string_less>> special_units;
|
||||
|
||||
for (const unit_type_data::unit_type_map::value_type &type_mapping : unit_types.types())
|
||||
{
|
||||
|
@ -407,7 +407,7 @@ std::vector<topic> generate_weapon_special_topics(const bool sort_generated)
|
|||
|
||||
for (const attack_type& atk : type.attacks()) {
|
||||
|
||||
std::vector<std::pair<t_string, t_string> > specials = atk.special_tooltips();
|
||||
std::vector<std::pair<t_string, t_string>> specials = atk.special_tooltips();
|
||||
for ( size_t i = 0; i != specials.size(); ++i )
|
||||
{
|
||||
special_description.emplace(specials[i].first, specials[i].second);
|
||||
|
@ -1488,7 +1488,7 @@ unsigned image_width(const std::string &filename)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void push_tab_pair(std::vector<std::pair<std::string, unsigned int> > &v, const std::string &s)
|
||||
void push_tab_pair(std::vector<std::pair<std::string, unsigned int>> &v, const std::string &s)
|
||||
{
|
||||
v.emplace_back(s, font::line_width(s, normal_font_size));
|
||||
}
|
||||
|
@ -1496,7 +1496,7 @@ void push_tab_pair(std::vector<std::pair<std::string, unsigned int> > &v, const
|
|||
std::string generate_table(const table_spec &tab, const unsigned int spacing)
|
||||
{
|
||||
table_spec::const_iterator row_it;
|
||||
std::vector<std::pair<std::string, unsigned> >::const_iterator col_it;
|
||||
std::vector<std::pair<std::string, unsigned>>::const_iterator col_it;
|
||||
unsigned int num_cols = 0;
|
||||
for (row_it = tab.begin(); row_it != tab.end(); ++row_it) {
|
||||
if (row_it->size() > num_cols) {
|
||||
|
|
|
@ -400,7 +400,7 @@ inline std::string bold(const std::string &s)
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
typedef std::vector<std::vector<std::pair<std::string, unsigned int > > > table_spec;
|
||||
typedef std::vector<std::vector<std::pair<std::string, unsigned int >> > table_spec;
|
||||
// Create a table using the table specs. Return markup with jumps
|
||||
// that create a table. The table spec contains a vector with
|
||||
// vectors with pairs. The pairs are the markup string that should
|
||||
|
@ -410,6 +410,6 @@ std::string generate_table(const table_spec &tab, const unsigned int spacing=fon
|
|||
// Return the width for the image with filename.
|
||||
unsigned image_width(const std::string &filename);
|
||||
|
||||
void push_tab_pair(std::vector<std::pair<std::string, unsigned int> > &v, const std::string &s);
|
||||
void push_tab_pair(std::vector<std::pair<std::string, unsigned int>> &v, const std::string &s);
|
||||
|
||||
} // end namespace help
|
||||
|
|
|
@ -536,7 +536,7 @@ std::string unit_topic_generator::operator()() const {
|
|||
attack_ss.str(clear_stringstream);
|
||||
// Show this attack's special, if it has any. Cross
|
||||
// reference it to the section describing the special.
|
||||
std::vector<std::pair<t_string, t_string> > specials = attack.special_tooltips();
|
||||
std::vector<std::pair<t_string, t_string>> specials = attack.special_tooltips();
|
||||
if (!specials.empty()) {
|
||||
std::string lang_special = "";
|
||||
const size_t specials_size = specials.size();
|
||||
|
|
|
@ -279,7 +279,7 @@ static void find_routes(
|
|||
const unit * teleporter, const team * current_team,
|
||||
const unit * skirmisher, const team * viewing_team,
|
||||
const std::map<map_location, int> * jamming_map=nullptr,
|
||||
std::vector<std::pair<int, int> > * full_cost_map=nullptr, bool check_vision=false)
|
||||
std::vector<std::pair<int, int>> * full_cost_map=nullptr, bool check_vision=false)
|
||||
{
|
||||
const gamemap& map = resources::gameboard->map();
|
||||
|
||||
|
@ -874,7 +874,7 @@ full_cost_map::full_cost_map(const unit& u, bool force_ignore_zoc,
|
|||
viewing_team_(viewing_team), see_all_(see_all), ignore_units_(ignore_units)
|
||||
{
|
||||
const gamemap& map = resources::gameboard->map();
|
||||
cost_map = std::vector<std::pair<int, int> >(map.w() * map.h(), std::make_pair(-1, 0));
|
||||
cost_map = std::vector<std::pair<int, int>>(map.w() * map.h(), std::make_pair(-1, 0));
|
||||
add_unit(u);
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ full_cost_map::full_cost_map(bool force_ignore_zoc,
|
|||
viewing_team_(viewing_team), see_all_(see_all), ignore_units_(ignore_units)
|
||||
{
|
||||
const gamemap& map = resources::gameboard->map();
|
||||
cost_map = std::vector<std::pair<int, int> >(map.w() * map.h(), std::make_pair(-1, 0));
|
||||
cost_map = std::vector<std::pair<int, int>>(map.w() * map.h(), std::make_pair(-1, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -292,7 +292,7 @@ struct full_cost_map
|
|||
// The second int is how many units can reach this hex.
|
||||
// (For some units some hexes or even a whole regions are unreachable)
|
||||
// To calculate a *average cost map* it is recommended to divide first/second.
|
||||
std::vector<std::pair<int, int> > cost_map;
|
||||
std::vector<std::pair<int, int>> cost_map;
|
||||
|
||||
private:
|
||||
const bool force_ignore_zoc_;
|
||||
|
|
|
@ -241,7 +241,7 @@ void teleport_map::get_adjacents(std::set<map_location>& adjacents, map_location
|
|||
|
||||
void teleport_map::get_sources(std::set<map_location>& sources) const {
|
||||
|
||||
std::map<std::string, std::set<map_location> >::const_iterator it;
|
||||
std::map<std::string, std::set<map_location>>::const_iterator it;
|
||||
for(it = sources_.begin(); it != sources_.end(); ++it) {
|
||||
sources.insert(it->second.begin(), it->second.end());
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ void teleport_map::get_sources(std::set<map_location>& sources) const {
|
|||
|
||||
void teleport_map::get_targets(std::set<map_location>& targets) const {
|
||||
|
||||
std::map<std::string, std::set<map_location> >::const_iterator it;
|
||||
std::map<std::string, std::set<map_location>>::const_iterator it;
|
||||
for(it = targets_.begin(); it != targets_.end(); ++it) {
|
||||
targets.insert(it->second.begin(), it->second.end());
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class vconfig;
|
|||
|
||||
namespace pathfind {
|
||||
|
||||
typedef std::pair<std::set<map_location>, std::set<map_location> >
|
||||
typedef std::pair<std::set<map_location>, std::set<map_location>>
|
||||
teleport_pair;
|
||||
|
||||
/*
|
||||
|
@ -136,9 +136,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
std::map<map_location, std::set<std::string> > teleport_map_;
|
||||
std::map<std::string, std::set<map_location> > sources_;
|
||||
std::map<std::string, std::set<map_location> > targets_;
|
||||
std::map<map_location, std::set<std::string>> teleport_map_;
|
||||
std::map<std::string, std::set<map_location>> sources_;
|
||||
std::map<std::string, std::set<map_location>> targets_;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace { // Helpers for get_tiles_radius() without a radius filter.
|
|||
// Ranges of rows are stored as pairs of a row number and a number of rows.
|
||||
typedef std::pair<int, size_t> row_range;
|
||||
// This is a map from column numbers to sets of ranges of rows.
|
||||
typedef std::map<int, std::set<row_range> > column_ranges;
|
||||
typedef std::map<int, std::set<row_range>> column_ranges;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,11 +40,11 @@ bool message_private_on = false;
|
|||
|
||||
bool haloes = true;
|
||||
|
||||
std::map<std::string, std::set<std::string> > completed_campaigns;
|
||||
std::map<std::string, std::set<std::string>> completed_campaigns;
|
||||
std::set<std::string> encountered_units_set;
|
||||
std::set<t_translation::terrain_code> encountered_terrains_set;
|
||||
|
||||
std::map<std::string, std::vector<std::string> > history_map;
|
||||
std::map<std::string, std::vector<std::string>> history_map;
|
||||
|
||||
acquaintances_map acquaintances;
|
||||
|
||||
|
@ -137,7 +137,7 @@ manager::manager() :
|
|||
manager::~manager()
|
||||
{
|
||||
config campaigns;
|
||||
typedef const std::pair<std::string, std::set<std::string> > cc_elem;
|
||||
typedef const std::pair<std::string, std::set<std::string>> cc_elem;
|
||||
for (cc_elem &elem : completed_campaigns) {
|
||||
config cmp;
|
||||
cmp["name"] = elem.first;
|
||||
|
@ -158,7 +158,7 @@ manager::~manager()
|
|||
[/line]
|
||||
*/
|
||||
config history;
|
||||
typedef std::pair<std::string, std::vector<std::string> > hack;
|
||||
typedef std::pair<std::string, std::vector<std::string>> hack;
|
||||
for (const hack& history_id : history_map) {
|
||||
|
||||
config history_id_cfg; // [history_id]
|
||||
|
@ -321,7 +321,7 @@ bool is_campaign_completed(const std::string& campaign_id) {
|
|||
}
|
||||
|
||||
bool is_campaign_completed(const std::string& campaign_id, const std::string &difficulty_level) {
|
||||
std::map<std::string, std::set<std::string> >::iterator it = completed_campaigns.find(campaign_id);
|
||||
std::map<std::string, std::set<std::string>>::iterator it = completed_campaigns.find(campaign_id);
|
||||
return it == completed_campaigns.end() ? false : it->second.count(difficulty_level) != 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ void replay::speak(const config& cfg)
|
|||
add_chat_message_location(base_->size() - 1);
|
||||
}
|
||||
|
||||
void replay::add_chat_log_entry(const config &cfg, std::back_insert_iterator<std::vector<chat_msg> > &i) const
|
||||
void replay::add_chat_log_entry(const config &cfg, std::back_insert_iterator<std::vector<chat_msg>> &i) const
|
||||
{
|
||||
if (!cfg) return;
|
||||
|
||||
|
@ -376,7 +376,7 @@ const std::vector<chat_msg>& replay::build_chat_log() const
|
|||
message_log.clear();
|
||||
std::vector<int>::const_iterator loc_it;
|
||||
int last_location = 0;
|
||||
std::back_insert_iterator<std::vector < chat_msg > > chat_log_appender( back_inserter(message_log));
|
||||
std::back_insert_iterator<std::vector < chat_msg >> chat_log_appender( back_inserter(message_log));
|
||||
for (loc_it = message_locations.begin(); loc_it != message_locations.end(); ++loc_it)
|
||||
{
|
||||
last_location = *loc_it;
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
void delete_upcoming_commands();
|
||||
private:
|
||||
|
||||
void add_chat_log_entry(const config &speak, std::back_insert_iterator< std::vector<chat_msg> > &i) const;
|
||||
void add_chat_log_entry(const config &speak, std::back_insert_iterator< std::vector<chat_msg>> &i) const;
|
||||
|
||||
config &command(int) const;
|
||||
void remove_command(int);
|
||||
|
|
|
@ -368,7 +368,7 @@ static config unit_abilities(const unit* u)
|
|||
config res;
|
||||
|
||||
boost::dynamic_bitset<> active;
|
||||
const std::vector<std::tuple<std::string, t_string,t_string,t_string> > &abilities = u->ability_tooltips(&active);
|
||||
const std::vector<std::tuple<std::string, t_string,t_string,t_string>> &abilities = u->ability_tooltips(&active);
|
||||
const size_t abilities_size = abilities.size();
|
||||
for ( size_t i = 0; i != abilities_size; ++i )
|
||||
{
|
||||
|
@ -760,7 +760,7 @@ static int attack_info(reports::context & rc, const attack_type &at, config &res
|
|||
|
||||
// Show this weapon damage and resistance against all the different units.
|
||||
// We want weak resistances (= good damage) first.
|
||||
std::map<int, std::set<std::string>, std::greater<int> > resistances;
|
||||
std::map<int, std::set<std::string>, std::greater<int>> resistances;
|
||||
std::set<std::string> seen_types;
|
||||
const team &unit_team = rc.dc().get_team(u.side());
|
||||
const team &viewing_team = rc.teams()[rc.screen().viewing_team()];
|
||||
|
@ -781,7 +781,7 @@ static int attack_info(reports::context & rc, const attack_type &at, config &res
|
|||
}
|
||||
}
|
||||
|
||||
typedef std::pair<int, std::set<std::string> > resist_units;
|
||||
typedef std::pair<int, std::set<std::string>> resist_units;
|
||||
for (const resist_units &resist : resistances) {
|
||||
int damage_with_resistance = round_damage(specials_damage, damage_multiplier * resist.first, damage_divisor);
|
||||
tooltip << "<b>" << damage_with_resistance << "</b> "
|
||||
|
@ -813,7 +813,7 @@ static int attack_info(reports::context & rc, const attack_type &at, config &res
|
|||
|
||||
at.set_specials_context_for_listing();
|
||||
boost::dynamic_bitset<> active;
|
||||
const std::vector<std::pair<t_string, t_string> > &specials = at.special_tooltips(&active);
|
||||
const std::vector<std::pair<t_string, t_string>> &specials = at.special_tooltips(&active);
|
||||
const size_t specials_size = specials.size();
|
||||
for ( size_t i = 0; i != specials_size; ++i )
|
||||
{
|
||||
|
@ -918,10 +918,10 @@ static config unit_weapons(reports::context & rc, const unit *attacker, const ma
|
|||
<< _("Total damage") << "<b>" << total_damage << "</b>\n";
|
||||
|
||||
// Create the hitpoints distribution.
|
||||
std::vector<std::pair<int, double> > hp_prob_vector;
|
||||
std::vector<std::pair<int, double>> hp_prob_vector;
|
||||
|
||||
// First, we sort the probabilities in ascending order.
|
||||
std::vector<std::pair<double, int> > prob_hp_vector;
|
||||
std::vector<std::pair<double, int>> prob_hp_vector;
|
||||
int i;
|
||||
|
||||
combatant* c = show_attacker ? &attacker_combatant : &defender_combatant;
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
|
||||
using generator_function = std::function<config(reports::context&)>;
|
||||
|
||||
typedef std::map<std::string, std::shared_ptr<reports::generator> > dynamic_report_generators;
|
||||
typedef std::map<std::string, std::shared_ptr<reports::generator>> dynamic_report_generators;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
virtual std::string my_name() { return "Application Lua Kernel"; }
|
||||
|
||||
typedef std::vector<std::function<bool(void)> > request_list;
|
||||
typedef std::vector<std::function<bool(void)>> request_list;
|
||||
|
||||
class thread {
|
||||
lua_State * T_;
|
||||
|
|
|
@ -1836,7 +1836,7 @@ int game_lua_kernel::intf_find_cost_map(lua_State *L)
|
|||
luaW_tovconfig(L, arg, filter);
|
||||
|
||||
std::vector<const ::unit*> real_units;
|
||||
typedef std::vector<std::tuple<map_location, int, std::string> > unit_type_vector;
|
||||
typedef std::vector<std::tuple<map_location, int, std::string>> unit_type_vector;
|
||||
unit_type_vector fake_units;
|
||||
|
||||
|
||||
|
@ -2826,7 +2826,7 @@ static int intf_synchronize_choices(lua_State *L)
|
|||
if(lua_isfunction(L, nextarg)) {
|
||||
null_func = nextarg++;
|
||||
};
|
||||
sides_for = lua_check<std::vector<int> >(L, nextarg++);
|
||||
sides_for = lua_check<std::vector<int>>(L, nextarg++);
|
||||
|
||||
lua_push(L, mp_sync::get_user_choice_multiple_sides(tagname, lua_synchronize(L, desc, human_func, null_func), std::set<int>(sides_for.begin(), sides_for.end())));
|
||||
return 1;
|
||||
|
|
|
@ -412,7 +412,7 @@ static int impl_unit_set(lua_State *L)
|
|||
}
|
||||
|
||||
if(strcmp(m, "advancements") == 0) {
|
||||
u.set_advancements(lua_check<std::vector<config> >(L, 3));
|
||||
u.set_advancements(lua_check<std::vector<config>>(L, 3));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ void plugins_manager::play_slice(const plugins_context & ctxt)
|
|||
plugins_[idx].queue = std::vector<event>();
|
||||
|
||||
//application_lua_kernel::requests_list requests =
|
||||
std::vector<std::function<bool(void)> > requests =
|
||||
std::vector<std::function<bool(void)>> requests =
|
||||
plugins_[idx].thread->run_script(ctxt, input);
|
||||
|
||||
DBG_PLG << "thread returned " << requests.size() << " requests\n";
|
||||
|
|
|
@ -825,7 +825,7 @@ std::pair<int, int> parse_range(const std::string& str)
|
|||
|
||||
std::vector<std::pair<int, int>> parse_ranges(const std::string& str)
|
||||
{
|
||||
std::vector< std::pair< int, int > > to_return;
|
||||
std::vector< std::pair< int, int >> to_return;
|
||||
std::vector<std::string> strs = utils::split(str);
|
||||
std::vector<std::string>::const_iterator i, i_end=strs.end();
|
||||
for(i = strs.begin(); i != i_end; ++i) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
};
|
||||
}
|
||||
|
||||
template<typename charT, typename traits = std::char_traits<charT> > class basic_string_view;
|
||||
template<typename charT, typename traits = std::char_traits<charT>> class basic_string_view;
|
||||
|
||||
template<typename charT, typename traits>
|
||||
class basic_string_view {
|
||||
|
@ -165,7 +165,7 @@ public:
|
|||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
||||
template<typename Allocator = std::allocator<charT> >
|
||||
template<typename Allocator = std::allocator<charT>>
|
||||
std::basic_string<charT, traits, Allocator> to_string(const Allocator& a = Allocator()) const {
|
||||
return std::basic_string<charT, traits, Allocator>(begin(), end(), a);
|
||||
}
|
||||
|
@ -604,15 +604,15 @@ const basic_string_view<charT, traits>& str) {
|
|||
return os;
|
||||
}
|
||||
|
||||
typedef basic_string_view<char, std::char_traits<char> > string_view;
|
||||
typedef basic_string_view<wchar_t, std::char_traits<wchar_t> > wstring_view;
|
||||
typedef basic_string_view<char, std::char_traits<char>> string_view;
|
||||
typedef basic_string_view<wchar_t, std::char_traits<wchar_t>> wstring_view;
|
||||
|
||||
#ifndef BOOST_NO_CXX11_CHAR16_T
|
||||
typedef basic_string_view<char16_t, std::char_traits<char16_t> > u16string_view;
|
||||
typedef basic_string_view<char16_t, std::char_traits<char16_t>> u16string_view;
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX11_CHAR32_T
|
||||
typedef basic_string_view<char32_t, std::char_traits<char32_t> > u32string_view;
|
||||
typedef basic_string_view<char32_t, std::char_traits<char32_t>> u32string_view;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -1581,7 +1581,7 @@ void server::handle_player_in_game(socket_ptr socket, std::shared_ptr<simple_wml
|
|||
<< g.name() << "\" (" << g.id() << ")\n" << data.output();
|
||||
}
|
||||
|
||||
typedef std::map<socket_ptr, std::deque<std::shared_ptr<simple_wml::document> > > SendQueue;
|
||||
typedef std::map<socket_ptr, std::deque<std::shared_ptr<simple_wml::document>> > SendQueue;
|
||||
SendQueue send_queue;
|
||||
void handle_send_to_player(socket_ptr socket);
|
||||
|
||||
|
|
|
@ -67,10 +67,10 @@ std::vector<int> side_filter::get_teams() const
|
|||
|
||||
static bool check_side_number(const team &t, const std::string &str)
|
||||
{
|
||||
std::vector<std::pair<int,int> > ranges = utils::parse_ranges(str);
|
||||
std::vector<std::pair<int,int>> ranges = utils::parse_ranges(str);
|
||||
int side_number = t.side();
|
||||
|
||||
std::vector<std::pair<int,int> >::const_iterator range, range_end = ranges.end();
|
||||
std::vector<std::pair<int,int>>::const_iterator range, range_end = ranges.end();
|
||||
for (range = ranges.begin(); range != range_end; ++range) {
|
||||
if(side_number >= range->first && side_number <= range->second) {
|
||||
return true;
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace statistics
|
|||
void reset_turn_stats(const std::string & save_id);
|
||||
stats calculate_stats(const std::string & save_id);
|
||||
/// Stats (and name) for each scenario. The pointers are never nullptr.
|
||||
typedef std::vector< std::pair<const std::string *, const stats *> > levels;
|
||||
typedef std::vector< std::pair<const std::string *, const stats *>> levels;
|
||||
/// Returns a list of names and stats for each scenario in the current campaign.
|
||||
levels level_stats(const std::string & save_id);
|
||||
} // end namespace statistics
|
||||
|
|
|
@ -92,7 +92,7 @@ private:
|
|||
void set_enabled(bool enabled) { enabled_ = enabled; }
|
||||
private:
|
||||
bool enabled_;
|
||||
std::vector<std::vector<bool> > data_;
|
||||
std::vector<std::vector<bool>> data_;
|
||||
};
|
||||
|
||||
struct team_info
|
||||
|
|
|
@ -215,7 +215,7 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni
|
|||
if(cache_.adjacent_matches == nullptr) {
|
||||
while(index >= std::distance(cache_.adjacent_match_cache.begin(), cache_.adjacent_match_cache.end())) {
|
||||
const vconfig& adj_cfg = adj_cfgs[cache_.adjacent_match_cache.size()];
|
||||
std::pair<terrain_filter, std::map<map_location,bool> > amc_pair(
|
||||
std::pair<terrain_filter, std::map<map_location,bool>> amc_pair(
|
||||
terrain_filter(adj_cfg, *this),
|
||||
std::map<map_location,bool>());
|
||||
cache_.adjacent_match_cache.push_back(amc_pair);
|
||||
|
@ -242,8 +242,8 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni
|
|||
}
|
||||
}
|
||||
}
|
||||
static std::vector<std::pair<int,int> > default_counts = utils::parse_ranges("1-6");
|
||||
std::vector<std::pair<int,int> > counts = (*i).has_attribute("count")
|
||||
static std::vector<std::pair<int,int>> default_counts = utils::parse_ranges("1-6");
|
||||
std::vector<std::pair<int,int>> counts = (*i).has_attribute("count")
|
||||
? utils::parse_ranges((*i)["count"]) : default_counts;
|
||||
if(!in_ranges(match_count, counts)) {
|
||||
return false;
|
||||
|
|
|
@ -89,7 +89,7 @@ private:
|
|||
std::unique_ptr<std::vector<std::set<map_location>>> adjacent_matches;
|
||||
|
||||
//adjacent_match_cache: optimize handling of [filter_adjacent_location] for match()
|
||||
std::vector< std::pair<terrain_filter, std::map<map_location,bool> > > adjacent_match_cache;
|
||||
std::vector< std::pair<terrain_filter, std::map<map_location,bool>> > adjacent_match_cache;
|
||||
|
||||
std::unique_ptr<unit_filter> ufilter_;
|
||||
};
|
||||
|
|
|
@ -128,7 +128,7 @@ static void test_control(T&& control)
|
|||
gui2::iteration::iterator< gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(control);
|
||||
|
||||
/***** INITIAL STATE *****/
|
||||
|
@ -148,7 +148,7 @@ static void test_control(T&& control)
|
|||
gui2::iteration::iterator< gui2::iteration::policy::order::top_down<
|
||||
false
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(control);
|
||||
|
||||
/***** INITIAL STATE *****/
|
||||
|
@ -157,11 +157,11 @@ static void test_control(T&& control)
|
|||
}
|
||||
|
||||
{
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<true, true, true> > iterator(control);
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<true, true, true>> iterator(control);
|
||||
BOOST_CHECK_EQUAL(iterator.at_end(), false);
|
||||
}
|
||||
{
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<false, false, false> > iterator(control);
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<false, false, false>> iterator(control);
|
||||
BOOST_CHECK_EQUAL(iterator.at_end(), true);
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ static void test_grid()
|
|||
gui2::iteration::iterator<gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(grid);
|
||||
|
||||
while(iterator.next()) {
|
||||
|
@ -216,7 +216,7 @@ static void test_grid()
|
|||
gui2::iteration::iterator<gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(grid);
|
||||
|
||||
for( ; !iterator.at_end(); ++iterator) {
|
||||
|
@ -232,7 +232,7 @@ static void test_grid()
|
|||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(grid);
|
||||
|
||||
while(iterator.next()) {
|
||||
|
@ -248,7 +248,7 @@ static void test_grid()
|
|||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
, true>>
|
||||
iterator(grid);
|
||||
|
||||
for( ; !iterator.at_end(); ++iterator) {
|
||||
|
|
|
@ -184,7 +184,7 @@ namespace {
|
|||
};
|
||||
|
||||
typedef std::pair<unsigned, unsigned> resolution;
|
||||
typedef std::vector<std::pair<unsigned, unsigned> > resolution_list;
|
||||
typedef std::vector<std::pair<unsigned, unsigned>> resolution_list;
|
||||
|
||||
template<class T>
|
||||
void test_resolutions(const resolution_list& resolutions)
|
||||
|
|
|
@ -134,7 +134,7 @@ static map_location::DIRECTION get_second (std::pair<size_t, std::string> arg) {
|
|||
|
||||
BOOST_AUTO_TEST_CASE ( map_location_characterization_test_default_mode )
|
||||
{
|
||||
std::vector<std::pair<size_t, std::string> > generated_answers = boost::assign::list_of(std::make_pair(7, "se"))
|
||||
std::vector<std::pair<size_t, std::string>> generated_answers = boost::assign::list_of(std::make_pair(7, "se"))
|
||||
(std::make_pair(6, "s"))
|
||||
(std::make_pair(6, "nw"))
|
||||
(std::make_pair(12, "n"))
|
||||
|
@ -200,7 +200,7 @@ BOOST_AUTO_TEST_CASE ( map_location_characterization_test_default_mode )
|
|||
|
||||
BOOST_AUTO_TEST_CASE ( map_location_characterization_test_radial_mode )
|
||||
{
|
||||
std::vector<std::pair<size_t, std::string> > generated_answers {
|
||||
std::vector<std::pair<size_t, std::string>> generated_answers {
|
||||
std::make_pair(7, "se"),
|
||||
std::make_pair(6, "sw"),
|
||||
std::make_pair(6, "n"),
|
||||
|
|
|
@ -259,9 +259,9 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<std::tuple<std::string, t_string, t_string, t_string> > unit::ability_tooltips(boost::dynamic_bitset<>* active_list) const
|
||||
std::vector<std::tuple<std::string, t_string, t_string, t_string>> unit::ability_tooltips(boost::dynamic_bitset<>* active_list) const
|
||||
{
|
||||
std::vector<std::tuple<std::string, t_string,t_string,t_string> > res;
|
||||
std::vector<std::tuple<std::string, t_string,t_string,t_string>> res;
|
||||
if ( active_list )
|
||||
active_list->clear();
|
||||
|
||||
|
@ -636,11 +636,11 @@ unit_ability_list attack_type::get_specials(const std::string& special) const
|
|||
* @a active_list is not nullptr. Otherwise specials are assumed active.
|
||||
* If the appropriate name is empty, the special is skipped.
|
||||
*/
|
||||
std::vector<std::pair<t_string, t_string> > attack_type::special_tooltips(
|
||||
std::vector<std::pair<t_string, t_string>> attack_type::special_tooltips(
|
||||
boost::dynamic_bitset<>* active_list) const
|
||||
{
|
||||
//log_scope("special_tooltips");
|
||||
std::vector<std::pair<t_string, t_string> > res;
|
||||
std::vector<std::pair<t_string, t_string>> res;
|
||||
if ( active_list )
|
||||
active_list->clear();
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ void unit_animation_component::apply_new_animation_effect(const config & effect)
|
|||
if(effect["id"].empty()) {
|
||||
unit_animation::add_anims(animations_, effect);
|
||||
} else {
|
||||
static std::map< std::string, std::vector<unit_animation> > animation_cache;
|
||||
static std::map< std::string, std::vector<unit_animation>> animation_cache;
|
||||
std::vector<unit_animation> &built = animation_cache[effect["id"]];
|
||||
if(built.empty()) {
|
||||
unit_animation::add_anims(built, effect);
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
bool get_special_bool(const std::string& special, bool simple_check=false) const;
|
||||
unit_ability_list get_specials(const std::string& special) const;
|
||||
std::vector<std::pair<t_string, t_string> > special_tooltips(boost::dynamic_bitset<>* active_list = nullptr) const;
|
||||
std::vector<std::pair<t_string, t_string>> special_tooltips(boost::dynamic_bitset<>* active_list = nullptr) const;
|
||||
std::string weapon_specials(bool only_active=false, bool is_backstab=false) const;
|
||||
void set_specials_context(const map_location& unit_loc, const map_location& other_loc,
|
||||
bool attacking, const_attack_ptr other_attack) const;
|
||||
|
|
|
@ -148,7 +148,7 @@ struct unit_filter_adjacent : public unit_filter_base
|
|||
++match_count;
|
||||
}
|
||||
|
||||
static std::vector<std::pair<int,int> > default_counts = utils::parse_ranges("1-6");
|
||||
static std::vector<std::pair<int,int>> default_counts = utils::parse_ranges("1-6");
|
||||
config::attribute_value i_count = cfg_["count"];
|
||||
return in_ranges(match_count, !i_count.blank() ? utils::parse_ranges(i_count) : default_counts);
|
||||
}
|
||||
|
|
|
@ -391,8 +391,8 @@ private:
|
|||
/** True if [hide_help] contains a 'all=yes' at its root. */
|
||||
bool hide_help_all_;
|
||||
// vectors containing the [hide_help] and its sub-tags [not]
|
||||
std::vector< std::set<std::string> > hide_help_type_;
|
||||
std::vector< std::set<std::string> > hide_help_race_;
|
||||
std::vector< std::set<std::string>> hide_help_type_;
|
||||
std::vector< std::set<std::string>> hide_help_race_;
|
||||
|
||||
const config *unit_cfg_;
|
||||
unit_type::BUILD_STATUS build_status_;
|
||||
|
|
|
@ -26,7 +26,7 @@ private:
|
|||
|
||||
struct nonterminal {
|
||||
nonterminal() : last_(1) {}
|
||||
std::vector<std::vector<std::string> > possibilities_;
|
||||
std::vector<std::vector<std::string>> possibilities_;
|
||||
mutable unsigned int last_;
|
||||
};
|
||||
|
||||
|
|
|
@ -222,10 +222,10 @@ namespace {
|
|||
break;
|
||||
}
|
||||
case LT:
|
||||
result = recursive_order_operation<std::less<unsigned int>, std::equal_to<unsigned int> >(lcc, rcc, 0);
|
||||
result = recursive_order_operation<std::less<unsigned int>, std::equal_to<unsigned int>>(lcc, rcc, 0);
|
||||
break;
|
||||
case GT:
|
||||
result = recursive_order_operation<std::greater<unsigned int>, std::equal_to<unsigned int> >(lcc, rcc, 0);
|
||||
result = recursive_order_operation<std::greater<unsigned int>, std::equal_to<unsigned int>>(lcc, rcc, 0);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
|
|
|
@ -58,13 +58,13 @@ public:
|
|||
action_ptr,
|
||||
boost::multi_index::indexed_by<
|
||||
boost::multi_index::random_access<
|
||||
boost::multi_index::tag< chronological > >,
|
||||
boost::multi_index::tag< chronological >>,
|
||||
boost::multi_index::hashed_non_unique<
|
||||
boost::multi_index::tag< by_unit >,
|
||||
boost::multi_index::const_mem_fun< action, size_t, &action::get_unit_id > >,
|
||||
boost::multi_index::const_mem_fun< action, size_t, &action::get_unit_id >>,
|
||||
boost::multi_index::hashed_non_unique<
|
||||
boost::multi_index::tag< by_hex >,
|
||||
boost::multi_index::const_mem_fun< action, map_location, &action::get_numbering_hex > >
|
||||
boost::multi_index::const_mem_fun< action, map_location, &action::get_numbering_hex >>
|
||||
>
|
||||
> action_set;
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ bool menu::basic_sorter::less(int column, const item& row1, const item& row2) co
|
|||
return level_1 > level_2;
|
||||
}
|
||||
|
||||
const std::map<int,std::vector<int> >::const_iterator itor = pos_sort_.find(column);
|
||||
const std::map<int,std::vector<int>>::const_iterator itor = pos_sort_.find(column);
|
||||
if(itor != pos_sort_.end()) {
|
||||
const std::vector<int>& pos = itor->second;
|
||||
if(row1.id >= pos.size()) {
|
||||
|
|
|
@ -144,7 +144,7 @@ public:
|
|||
private:
|
||||
std::set<int> alpha_sort_, numeric_sort_, id_sort_, xp_sort_, level_sort_;
|
||||
std::map<int,int> redirect_sort_;
|
||||
std::map<int,std::vector<int> > pos_sort_;
|
||||
std::map<int,std::vector<int>> pos_sort_;
|
||||
int xp_col_; //used by level sort
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue