editor_action* editor_action_chain::pop_first_action() { if(empty()) { throw editor_action_exception("pop_first_action requested on an empty action_chain"); } editor_action* last = actions_.front(); actions_.pop_front(); return last; }
gamemap editor_map::mask_to(const gamemap& target) const { if (target.w() != w() || target.h() != h()) { throw editor_action_exception(_("The size of the target map is different from the current map")); } gamemap mask(target); map_location iter; for (iter.x = -border_size(); iter.x < w() + border_size(); ++iter.x) { for (iter.y = -border_size(); iter.y < h() + border_size(); ++iter.y) { if (target.get_terrain(iter) == get_terrain(iter)) { mask.set_terrain(iter, t_translation::FOGGED); } } } return mask; }
editor_action* editor_action_chain::pop_last_action() { if (empty()) throw editor_action_exception("pop_last_action requested on an empty action_chain"); editor_action* last = actions_.back(); actions_.pop_back(); return last; }