Remove trailing whitespace.
This commit is contained in:
parent
a18cde5684
commit
4d27743d10
22 changed files with 68 additions and 68 deletions
|
@ -1035,7 +1035,7 @@ namespace {
|
|||
gui::filter_textbox* filter = new gui::filter_textbox(disp.video(),
|
||||
_("Filter: "), options, options_to_filter, 1, addon_dialog, 300);
|
||||
addon_dialog.set_textbox(filter);
|
||||
|
||||
|
||||
// Scroll the menu to the previous selection
|
||||
addon_menu->move_selection(old_index);
|
||||
|
||||
|
@ -1061,13 +1061,13 @@ namespace {
|
|||
return;
|
||||
}
|
||||
|
||||
// Handle download
|
||||
// Handle download
|
||||
install_addon(disp, * addons_tree, addons[index], titles[index], types[index],
|
||||
uploads[index], versions[index], net_manager, sock, do_refresh);
|
||||
|
||||
// Show the dialog again, and position it on the same item installed
|
||||
download_addons(disp, remote_host, update_mode, do_refresh, index);
|
||||
|
||||
|
||||
} catch(config::error& e) {
|
||||
ERR_CFG << "config::error thrown during transaction with add-on server; \""<< e.message << "\"\n";
|
||||
gui::show_error_message(disp, _("Network communication error."));
|
||||
|
@ -1079,7 +1079,7 @@ namespace {
|
|||
gui::show_error_message(disp, _("A problem occurred when trying to create the files necessary to install this add-on."));
|
||||
} catch(twml_exception& e) {
|
||||
e.show(disp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void uninstall_local_addons(game_display& disp, bool* should_reload_cfg)
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
virtual void set_team(int team) { info_.team_num = team; }
|
||||
|
||||
/** Evaluate */
|
||||
virtual std::string evaluate(const std::string& /*str*/)
|
||||
virtual std::string evaluate(const std::string& /*str*/)
|
||||
{ return "evaluate command not implemented by this AI"; }
|
||||
|
||||
/** Return a message with information about the ai. Useful for making debugging ai-independent. */
|
||||
|
|
|
@ -700,7 +700,7 @@ void editor_controller::refresh_after_action(bool drag_part)
|
|||
} else {
|
||||
if (get_map_context().needs_terrain_rebuild()) {
|
||||
if ((auto_update_transitions_ == TransitionUpdateMode::on)
|
||||
|| ((auto_update_transitions_ == TransitionUpdateMode::partial)
|
||||
|| ((auto_update_transitions_ == TransitionUpdateMode::partial)
|
||||
&& (!drag_part || get_map_context().everything_changed()))) {
|
||||
gui().rebuild_all();
|
||||
get_map_context().set_needs_terrain_rebuild(false);
|
||||
|
@ -1130,7 +1130,7 @@ void editor_controller::hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command)
|
|||
hotkey::get_hotkey(command).get_description());
|
||||
gui().invalidate_game_status();
|
||||
} else {
|
||||
ERR_ED << "Invalid hotkey command ("
|
||||
ERR_ED << "Invalid hotkey command ("
|
||||
<< static_cast<int>(command) << ") passed to set_mouse_action\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -416,7 +416,7 @@ private:
|
|||
if (args().size() > 3) weapon = args()[3]->evaluate(variables).as_int();
|
||||
else weapon = -1;
|
||||
|
||||
map_location attacker_location =
|
||||
map_location attacker_location =
|
||||
convert_variant<location_callable>(args()[0]->evaluate(variables))->loc();
|
||||
if(ai_.get_info().units.count(attacker_location) == 0) {
|
||||
ERR_AI << "Performing calculate_outcome() with non-existent attacker at (" <<
|
||||
|
@ -424,7 +424,7 @@ private:
|
|||
return variant();
|
||||
}
|
||||
|
||||
map_location defender_location =
|
||||
map_location defender_location =
|
||||
convert_variant<location_callable>(args()[2]->evaluate(variables))->loc();
|
||||
if(ai_.get_info().units.count(defender_location) == 0) {
|
||||
ERR_AI << "Performing calculate_outcome() with non-existent defender at (" <<
|
||||
|
@ -1009,7 +1009,7 @@ private:
|
|||
if (u_type)
|
||||
{
|
||||
const unit_type& un = u_type->get_unit_type();
|
||||
|
||||
|
||||
if( un.movement() < un.movement_type().movement_cost(ai_.get_info().map, ai_.get_info().map[loc]) )
|
||||
return variant();
|
||||
|
||||
|
@ -1987,10 +1987,10 @@ bool formula_ai::execute_variant(const variant& var, bool commandline)
|
|||
} else {
|
||||
throw formula_error("Incorrect result of calling the move() formula", "", "", 0);
|
||||
}
|
||||
|
||||
|
||||
LOG_AI << "MOVE: " << move->src().x+1 << "," << move->src().y+1 << " -> " << move->dst().x+1 << "," << move->dst().y+1 << "\n";
|
||||
made_move = true;
|
||||
|
||||
|
||||
} else {
|
||||
ERR_AI << "IMPOSSIBLE MOVE ORDER - MOVE FAILED\n";
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ private:
|
|||
|
||||
const map_location location = convert_variant<location_callable>(var0)->loc();
|
||||
std::string text;
|
||||
|
||||
|
||||
if(arguments.size() == 2) {
|
||||
text = var1.to_debug_string();
|
||||
display_float(location,text);
|
||||
|
@ -190,7 +190,7 @@ private:
|
|||
return var2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void display_float(const map_location& location, const std::string& text) const{
|
||||
game_display::get_singleton()->float_label(location,text,255,0,0);
|
||||
|
|
|
@ -1004,7 +1004,7 @@ void game_display::parse_team_overlays()
|
|||
const team& prev_team = teams_[playing_team()-1 < teams_.size() ? playing_team()-1 : teams_.size()-1];
|
||||
foreach (const game_display::overlay_map::value_type i, overlays_) {
|
||||
const overlay& ov = i.second;
|
||||
if (!ov.team_name.empty() &&
|
||||
if (!ov.team_name.empty() &&
|
||||
((ov.team_name.find(curr_team.team_name()) + 1) != 0) !=
|
||||
((ov.team_name.find(prev_team.team_name()) + 1) != 0))
|
||||
{
|
||||
|
|
|
@ -599,9 +599,9 @@ void twindow::layout()
|
|||
std::stringstream sstr;
|
||||
sstr << __FILE__ << ":" << __LINE__ << " in function '" << __func__
|
||||
<< "' found the following problem: Failed to size window;"
|
||||
<< " wanted size " << size
|
||||
<< " wanted size " << size
|
||||
<< " available size "
|
||||
<< maximum_width << ',' << maximum_height
|
||||
<< maximum_width << ',' << maximum_height
|
||||
<< " screen size "
|
||||
<< settings::screen_width << ',' << settings::screen_height
|
||||
<< '.';
|
||||
|
@ -856,7 +856,7 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* this is controlled by a window. A widget has an internal size cache and
|
||||
* if the value in the cache is not equal to 0,0 that value is its best
|
||||
* size. This value gets set when the widget can honour a resize request.
|
||||
* It will be set with the value which honours the request.
|
||||
* It will be set with the value which honours the request.
|
||||
*
|
||||
* - Grid; A grid is an invisible container which holds one or more widgets.
|
||||
* Several widgets have a grid in them to hold multiple widgets eg panels
|
||||
|
@ -910,7 +910,7 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* - Clear the internal best size cache for all widgets.
|
||||
* - For widgets with scrollbars hide them unless the scrollbar_mode is
|
||||
* ALWAYS.
|
||||
* - Handle shared sizes:
|
||||
* - Handle shared sizes:
|
||||
* - Height and width:
|
||||
* - Get the best size for all widgets that share height and width.
|
||||
* - Set the maximum of width and height as best size for all these
|
||||
|
@ -924,7 +924,7 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* - Start layout loop:
|
||||
* - Get best size.
|
||||
* - If width <= maximum_width && height <= maximum_height we're done.
|
||||
* - If width > maximum_width, optimize the width:
|
||||
* - If width > maximum_width, optimize the width:
|
||||
* - For every grid cell in a grid row there will be a resize request:
|
||||
* - Sort the widgets in the row on the resize priority.
|
||||
* - Loop through this priority queue until the row fits
|
||||
|
@ -932,7 +932,7 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* widgets are tried to reduce the full size.
|
||||
* - Try to shrink the widgets by either wrapping or using a
|
||||
* scrollbar.
|
||||
* - If the row fits in the wanted width this row is done.
|
||||
* - If the row fits in the wanted width this row is done.
|
||||
* - Else try the next priority.
|
||||
* - All priorities done and the width still doesn't fit.
|
||||
* - Loop through this priority queue until the row fits.
|
||||
|
@ -940,11 +940,11 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* widgets are tried to reduce the full size.
|
||||
* - Try to shrink the widgets by sizing them smaller as really
|
||||
* wanted. For labels, buttons etc. they get ellipsized .
|
||||
* - If the row fits in the wanted width this row is done.
|
||||
* - If the row fits in the wanted width this row is done.
|
||||
* - Else try the next priority.
|
||||
* - All priorities done and the width still doesn't fit.
|
||||
* - Throw a layout width doesn't fit exception.
|
||||
* - If height > maximum_height, optimize the height:
|
||||
* - If height > maximum_height, optimize the height:
|
||||
* - For every grid cell in a grid column there will be a resize request:
|
||||
* - Sort the widgets in the column on the resize priority.
|
||||
* - Loop through this priority queue until the column fits:
|
||||
|
@ -953,8 +953,8 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* - Try to shrink the widgets by using a scrollbar.
|
||||
* - If succeeded for a widget the width is influenced and the
|
||||
* width might be invalid.
|
||||
* - Throw a width modified exception.
|
||||
* - If the column fits in the wanted height this column is done.
|
||||
* - Throw a width modified exception.
|
||||
* - If the column fits in the wanted height this column is done.
|
||||
* - Else try the next priority.
|
||||
* - All priorities done and the height still doesn't fit.
|
||||
* - Loop through this priority queue until the column fits.
|
||||
|
@ -962,14 +962,14 @@ void twindow::generate_dot_file(const std::string& generator,
|
|||
* widgets are tried to reduce the full size.
|
||||
* - Try to shrink the widgets by sizing them smaller as really
|
||||
* wanted. For labels, buttons etc. they get ellipsized .
|
||||
* - If the column fits in the wanted height this column is done.
|
||||
* - If the column fits in the wanted height this column is done.
|
||||
* - Else try the next priority.
|
||||
* - All priorities done and the height still doesn't fit.
|
||||
* - Throw a layout height doesn't fit exception.
|
||||
* - End layout loop.
|
||||
*
|
||||
* - Catch width modified exception:
|
||||
* - Goto relayout.
|
||||
* - Goto relayout.
|
||||
*
|
||||
* - Catch layout width doesn't fit exception:
|
||||
* - If the window has a horizontal scrollbar which isn't shown but can be
|
||||
|
|
|
@ -41,7 +41,7 @@ std::string get_salt(const std::string& hash) {
|
|||
bool is_valid_hash(const std::string& hash) {
|
||||
if(hash.size() != 34) return false;
|
||||
if(hash.substr(0,3) != hash_prefix) return false;
|
||||
|
||||
|
||||
const int iteration_count = get_iteration_count(hash);
|
||||
if(iteration_count < 7 || iteration_count > 30) return false;
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace image {
|
|||
//a generic image locator. Abstracts the location of an image.
|
||||
class locator
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum type { NONE, FILE, SUB_FILE };
|
||||
|
||||
|
||||
|
@ -128,14 +128,14 @@ namespace image {
|
|||
int center_x_;
|
||||
int center_y_;
|
||||
};
|
||||
|
||||
|
||||
friend size_t hash_value(const value&);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @TODO replace this with std::unordered_map<value, int> or boost::unordered_map<value, int>
|
||||
* boost::unordered_map can almost just be dropped in as boost::hash<T>(T val) will return hash_value(val), but it
|
||||
* boost::unordered_map can almost just be dropped in as boost::hash<T>(T val) will return hash_value(val), but it
|
||||
* requires boost 1.35 (preferably 1.36 or later)
|
||||
*
|
||||
**/
|
||||
|
|
|
@ -252,7 +252,7 @@ bool is_cjk_char(const wchar_t ch)
|
|||
*/
|
||||
|
||||
//FIXME add range from Japanese-specific and Korean-specific section if you know the characters are used today.
|
||||
return
|
||||
return
|
||||
//Han Ideographs: all except Supplement
|
||||
(ch >= 0x4e00 && ch < 0x9fcf) ||
|
||||
(ch >= 0x3400 && ch < 0x4dbf) ||
|
||||
|
@ -334,7 +334,7 @@ inline bool no_break_after(const wchar_t ch)
|
|||
* don't break after these Chinese characters
|
||||
* contains left side of different kinds of brackets and quotes
|
||||
*/
|
||||
ch == 0x3014 || ch == 0x3016 || ch == 0x3008 || ch == 0x301a || ch == 0x3008 ||
|
||||
ch == 0x3014 || ch == 0x3016 || ch == 0x3008 || ch == 0x301a || ch == 0x3008 ||
|
||||
ch == 0x300a || ch == 0x300c || ch == 0x300e || ch == 0x3010 || ch == 0x301d;
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ inline bool no_break_before(const wchar_t ch)
|
|||
ch == 0x30e3 || ch == 0x30e5 || ch == 0x30e7 || ch == 0x30ee || ch == 0x30f5 ||
|
||||
ch == 0x30f6 || ch == 0x30fb || ch == 0x30fc || ch == 0x30fd || ch == 0x30fe ||
|
||||
ch == 0xff01 || ch == 0xff09 || ch == 0xff0c || ch == 0xff0e || ch == 0xff1a ||
|
||||
ch == 0xff1b || ch == 0xff1f || ch == 0xff3d || ch == 0xff5d ||
|
||||
ch == 0xff1b || ch == 0xff1f || ch == 0xff3d || ch == 0xff5d ||
|
||||
|
||||
/**
|
||||
* FIXME don't break before these Korean characters
|
||||
|
|
|
@ -107,7 +107,7 @@ bool mouse_handler_base::mouse_motion_default(int x, int y, bool /*update*/)
|
|||
if (is_dragging() && !dragging_started_) {
|
||||
if ((dragging_left_ && (SDL_GetMouseState(&mx,&my) & SDL_BUTTON_LEFT) != 0)
|
||||
|| (dragging_right_ && (SDL_GetMouseState(&mx,&my) & SDL_BUTTON_RIGHT) != 0)) {
|
||||
const double drag_distance = std::pow(static_cast<double>(drag_from_x_- mx), 2)
|
||||
const double drag_distance = std::pow(static_cast<double>(drag_from_x_- mx), 2)
|
||||
+ std::pow(static_cast<double>(drag_from_y_- my), 2);
|
||||
if (drag_distance > drag_threshold()*drag_threshold()) {
|
||||
dragging_started_ = true;
|
||||
|
|
|
@ -437,7 +437,7 @@ void play_controller::init_side(const unsigned int team_index, bool /*is_replay*
|
|||
// and the player should get income now.
|
||||
// Healing/income happen if it's not the first turn of processing,
|
||||
// or if we are loading a game, and this is not the player it started with.
|
||||
const bool turn_refresh = ( (status_.turn() > start_turn_) || (loading_game_ && team_index != (first_player_ - 1)) )
|
||||
const bool turn_refresh = ( (status_.turn() > start_turn_) || (loading_game_ && team_index != (first_player_ - 1)) )
|
||||
&& (status_.turn() > 1);
|
||||
|
||||
|
||||
|
|
|
@ -529,10 +529,10 @@ void playsingle_controller::play_turn(bool save)
|
|||
skip_next_turn_ = false;
|
||||
throw end_turn_exception();
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* Commented this out at dfranke's request,
|
||||
* effectively reverting his commit 34278,
|
||||
* because it introduced blocker bug #13298:
|
||||
* because it introduced blocker bug #13298:
|
||||
* reproducible hang in dialog code
|
||||
*/
|
||||
//input_blocker blocker;
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
|
||||
std::string id_;
|
||||
std::string file_path_;
|
||||
|
||||
|
||||
unsigned int ms_before_, ms_after_;
|
||||
|
||||
bool once_;
|
||||
|
|
|
@ -83,7 +83,7 @@ void controller::build_pages()
|
|||
|
||||
// page* story_page = new page(*gamestate_, cfg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ void page::resolve_wml(const vconfig& page_cfg)
|
|||
|
||||
// TODO recursive eval
|
||||
// TODO image stack
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(xi.first == "switch") {
|
||||
|
|
|
@ -227,7 +227,7 @@ gui2::tpoint ttext::get_column_line(const gui2::tpoint& position) const
|
|||
// Now convert this offset to a column, this way is a bit hacky but haven't
|
||||
// found a better solution yet.
|
||||
|
||||
/**
|
||||
/**
|
||||
* @todo There's still a bug left. When you select a text which is in the
|
||||
* ellipses on the right side the text gets reformatted with ellipses on
|
||||
* the left and the selected character is not the one under the cursor.
|
||||
|
|
|
@ -283,7 +283,7 @@ public:
|
|||
const map_location& second_loc = map_location::null_location,
|
||||
const int damage=0,
|
||||
const unit_animation::hit_type hit_type = unit_animation::INVALID,
|
||||
const attack_type* attack=NULL,const attack_type* second_attack = NULL,
|
||||
const attack_type* attack=NULL,const attack_type* second_attack = NULL,
|
||||
int swing_num =0) const;
|
||||
|
||||
bool get_ability_bool(const std::string& ability, const map_location& loc) const;
|
||||
|
|
|
@ -949,7 +949,7 @@ void unit_animator::wait_until(int animation_time) const
|
|||
disp->draw();
|
||||
events::pump();
|
||||
int end_tick = animated_units_[0].my_unit->get_animation()->time_to_tick(animation_time);
|
||||
while (SDL_GetTicks() < static_cast<unsigned int>(end_tick)
|
||||
while (SDL_GetTicks() < static_cast<unsigned int>(end_tick)
|
||||
- std::min<int>(static_cast<unsigned int>(20/speed),20)) {
|
||||
|
||||
disp->delay(std::max<int>(0,
|
||||
|
|
|
@ -87,7 +87,7 @@ static void move_unit_between(const map_location& a, const map_location& b, unit
|
|||
// This code causes backwards teleport because the time > 150 causes offset > 1.0
|
||||
// which will not match with the following -1.0
|
||||
// if( target_time - animator.get_animation_time_potential() < 100 ) target_time +=150;
|
||||
|
||||
|
||||
animator.wait_until(target_time);
|
||||
// debug code, see unit_frame::redraw()
|
||||
// std::cout << " end\n";
|
||||
|
@ -238,7 +238,7 @@ void unit_attack(
|
|||
int swing,std::string hit_text,bool drain,std::string att_text)
|
||||
{
|
||||
game_display* disp = game_display::get_singleton();
|
||||
if(!disp ||disp->video().update_locked() || disp->video().faked() ||
|
||||
if(!disp ||disp->video().update_locked() || disp->video().faked() ||
|
||||
(disp->fogged(a) && disp->fogged(b)) || preferences::show_combat() == false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ unit_map::const_unit_iterator unit_map::begin() const {
|
|||
void unit_map::add(const map_location &l, const unit &u) {
|
||||
insert(new std::pair<map_location,unit>(l, u));
|
||||
}
|
||||
|
||||
|
||||
void unit_map::move(const map_location &src, const map_location &dst) {
|
||||
std::pair<map_location,unit> *p = extract(src);
|
||||
assert(p && "attempt to move unit at location with no unit");
|
||||
|
@ -252,7 +252,7 @@ void unit_map::clear()
|
|||
}
|
||||
|
||||
void unit_map::clean_invalid() {
|
||||
if (num_iters_ > 0 || num_invalid_ < lmap_.size())
|
||||
if (num_iters_ > 0 || num_invalid_ < lmap_.size())
|
||||
return;
|
||||
|
||||
size_t num_cleaned = 0;
|
||||
|
|
|
@ -43,7 +43,7 @@ private:
|
|||
iterator_counter(const unit_map* map) : map_(map)
|
||||
{ if (map_) map_->add_iter(); }
|
||||
|
||||
iterator_counter(const iterator_counter& i) : map_(i.map_)
|
||||
iterator_counter(const iterator_counter& i) : map_(i.map_)
|
||||
{ if (map_) map_->add_iter(); }
|
||||
|
||||
iterator_counter& operator=(const iterator_counter &that) {
|
||||
|
@ -55,7 +55,7 @@ private:
|
|||
return *this;
|
||||
}
|
||||
|
||||
~iterator_counter()
|
||||
~iterator_counter()
|
||||
{if (map_) map_->remove_iter(); }
|
||||
private:
|
||||
const unit_map* map_;
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
bool valid() const { return policy_.valid(i_, map_); }
|
||||
|
||||
bool operator==(const iterator_base& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator!=(const iterator_base& rhs) const { return !operator==(rhs); }
|
||||
bool operator!=(const iterator_base& rhs) const { return !operator==(rhs); }
|
||||
|
||||
template <template <typename> class that_policy, typename that_types>
|
||||
iterator_base(const iterator_base<that_policy, that_types>& that) :
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
counter_(that.counter_),
|
||||
map_(that.map_),
|
||||
i_(that.i_)
|
||||
{
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(convertible<that_policy<that_types>, iter_policy<iter_types> >) != 0);
|
||||
BOOST_STATIC_ASSERT(sizeof(convertible<that_types, iter_types>) != 0);
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ public:
|
|||
map_type* get_map() const { return map_; }
|
||||
|
||||
template <template <typename> class X, typename Y> friend struct iterator_base;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
iter_policy<iter_types> policy_;
|
||||
iterator_counter counter_;
|
||||
map_type* map_;
|
||||
|
@ -168,14 +168,14 @@ public:
|
|||
|
||||
unit_policy() { }
|
||||
unit_policy(const iterator_type&, const unit_map*) { }
|
||||
|
||||
|
||||
void update(const iterator_type&, const unit_map*) { }
|
||||
|
||||
bool valid(const iterator_type& i, const unit_map* map) const { return i != map->map_.end() && i->second.valid(); }
|
||||
};
|
||||
|
||||
template <typename iter_types>
|
||||
struct unit_xy_policy {
|
||||
struct unit_xy_policy {
|
||||
typedef typename iter_types::iterator_type iterator_type;
|
||||
|
||||
unit_xy_policy() { }
|
||||
|
@ -187,13 +187,13 @@ public:
|
|||
|
||||
bool valid(const iterator_type& iter, const unit_map* map) const {
|
||||
return iter != map->map_.end() && iter->second.valid() && iter->second.get_location() == loc_;
|
||||
}
|
||||
}
|
||||
private:
|
||||
map_location loc_;
|
||||
};
|
||||
|
||||
template <typename iter_types>
|
||||
struct xy_accessor_base {
|
||||
struct xy_accessor_base {
|
||||
typedef typename iter_types::map_type map_type;
|
||||
typedef typename iter_types::iterator_type iterator_type;
|
||||
typedef typename iter_types::reference_type reference_type;
|
||||
|
@ -205,7 +205,7 @@ public:
|
|||
xy_accessor_base(const xy_accessor_base<that_types>& that) :
|
||||
counter_(that.counter_),
|
||||
loc_(that.loc_),
|
||||
map_(that.map_)
|
||||
map_(that.map_)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(convertible<that_types, iter_types>) != 0);
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ public:
|
|||
* unit_iter -> xy_unit_iter
|
||||
* unit_iter -> xy_accessor
|
||||
*/
|
||||
|
||||
/**
|
||||
* unit_iterators iterate over all units in the unit_map. A unit_iterator is invalidated if
|
||||
|
||||
/**
|
||||
* unit_iterators iterate over all units in the unit_map. A unit_iterator is invalidated if
|
||||
* unit_map::erase, unit_map::extract, or unit_map::replace are called with the location of the
|
||||
* unit that the unit_iterator points to. It will become valid again if unit_map::add is called with
|
||||
* a pair containing the unit that the iterator points to. Basically, as long as the unit is on the
|
||||
|
@ -277,8 +277,8 @@ public:
|
|||
|
||||
|
||||
/**
|
||||
* Lookups can be done by map_location, by unit::underlying_id(), or by unit::id().
|
||||
* Looking up with unit::id() is slow.
|
||||
* Lookups can be done by map_location, by unit::underlying_id(), or by unit::id().
|
||||
* Looking up with unit::id() is slow.
|
||||
* Returned iterators can be implicitly converted to the other types.
|
||||
*/
|
||||
unit_iterator find(const map_location& loc) ;
|
||||
|
@ -299,7 +299,7 @@ public:
|
|||
|
||||
unit_iterator end() { return iterator(map_.end(), this); }
|
||||
const_unit_iterator end() const { return const_iterator(map_.end(), this); }
|
||||
|
||||
|
||||
size_t size() const { return lmap_.size(); }
|
||||
|
||||
void clear();
|
||||
|
@ -406,7 +406,7 @@ unit_map::iterator_base<iter_policy, iter_types>& unit_map::iterator_base<iter_p
|
|||
|
||||
if (i_ != map_->map_.end()) policy_.update(i_, map_);
|
||||
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <template <typename> class iter_policy, typename iter_types>
|
||||
|
@ -419,13 +419,13 @@ unit_map::iterator_base<iter_policy, iter_types> unit_map::iterator_base<iter_po
|
|||
template <template <typename> class iter_policy, typename iter_types>
|
||||
unit_map::iterator_base<iter_policy, iter_types>& unit_map::iterator_base<iter_policy, iter_types>::operator--() {
|
||||
assert(i_ != map_->map_.begin());
|
||||
|
||||
|
||||
--i_;
|
||||
while (i_ != map_->map_.begin() && !i_->second.valid()) --i_;
|
||||
|
||||
if (i_->second.valid()) policy_.update(i_, map_);
|
||||
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <template <typename> class iter_policy, typename iter_types>
|
||||
|
|
Loading…
Add table
Reference in a new issue