46 std::unique_ptr<editor_action>
clone()
const override;
48 const std::string&
get_name()
const override;
73 virtual void extend(
const editor_map& map,
const std::set<map_location>& locs) = 0;
77 static const std::string name(
"extendable");
103 std::unique_ptr<editor_action>
clone()
const override;
127 void append_action(std::unique_ptr<editor_action>
a);
132 void prepend_action(std::unique_ptr<editor_action> a);
145 std::unique_ptr<editor_action> pop_last_action();
151 std::unique_ptr<editor_action> pop_first_action();
163 const std::string&
get_name()
const override;
169 std::deque<std::unique_ptr<editor_action>>
actions_;
186 static const std::string name(
"location");
208 static const std::string name(
"location_terrain");
227 void extend(
const editor_map& map,
const std::set<map_location>& locs)
override;
231 static const std::string name(
"area");
251 std::unique_ptr<editor_action>
clone()
const override;
254 void extend(
const editor_map& map,
const std::set<map_location>& locs)
override;
255 const std::string&
get_name()
const override;
272 , one_layer_(one_layer)
276 std::unique_ptr<editor_action>
clone()
const override;
279 const std::string&
get_name()
const override;
295 , one_layer_(one_layer)
299 std::unique_ptr<editor_action>
clone()
const override;
302 const std::string&
get_name()
const override;
321 std::unique_ptr<editor_action>
clone()
const override;
324 const std::string&
get_name()
const override;
344 , x_offset_(x_offset)
345 , y_offset_(y_offset)
350 std::unique_ptr<editor_action>
clone()
const override;
352 const std::string&
get_name()
const override;
371 std::unique_ptr<editor_action>
clone()
const override;
373 const std::string&
get_name()
const override;
387 std::unique_ptr<editor_action>
clone()
const override;
389 const std::string&
get_name()
const override;
406 std::unique_ptr<editor_action>
clone()
const override;
409 const std::string&
get_name()
const override;
Randomize terrain in an area.
A map fragment – a collection of locations and information abut them.
const terrain_code NONE_TERRAIN
static const map_location & ZERO()
editor_action_paint_area(const std::set< map_location > &area, const t_translation::terrain_code &t, bool one_layer=false)
const std::string & get_name() const override
Base class for actions which act on a specified location (and possibly on other locations that can be...
const std::string & get_name() const override
Base class for area-affecting actions.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
Paste a map fragment into the map.
Base class for editor actions.
Container action wrapping several actions into one.
Replace contents of the entire map, Useful as a fallback undo method when something else would be imp...
editor_action_starting_position(map_location loc, std::string loc_id)
editor_action_create_mask(const editor_map &target)
Set starting position action, sets location ids (both for starting locations and for non-starting loc...
const std::string & get_name() const override
std::deque< std::unique_ptr< editor_action > > actions_
The action pointers owned by this action chain.
void perform_without_undo(map_context &m) const override
Perform the action without creating an undo action.
Encapsulates the map of the game.
editor_action_apply_mask(const gamemap &mask)
Base class for actions which in addition to acting on a hex, act with one terrain type...
Manage the empty-palette in the editor.
Paint the same terrain on a number of locations on the map.
editor_action_shuffle_area(const std::set< map_location > &area)
Encapsulates the map of the game.
editor_action_fill(map_location loc, const t_translation::terrain_code &t, bool one_layer=false)
editor_action_whole_map(const editor_map &m)
editor_action_location(map_location loc)
virtual int action_count() const
This class adds extra editor-specific functionality to a normal gamemap.
editor_action_paste(const map_fragment &paste, const map_location &offset=map_location::ZERO())
t_translation::terrain_code t_
Base class for all editor actions.
editor_action_resize_map(int x_size, int y_size, int x_offset, int y_offset, const t_translation::terrain_code &fill=t_translation::NONE_TERRAIN)
Base class for actions that: 1) operate on an area 2) can be used as undo for a click-drag operation ...
This class wraps around a map to provide a concise interface for the editor to work with...
virtual std::unique_ptr< editor_action > perform(map_context &) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
t_translation::terrain_code fill_
editor_action_chain(std::deque< std::unique_ptr< editor_action >> actions)
Create an action chain from a deque of action pointers.
const std::string & get_name() const override
editor_action_extendable()
t_translation::terrain_code t_
editor_action_chain()
Create an empty action chain.
std::unique_ptr< editor_action > clone() const override
Action cloning.
editor_action_area(const std::set< map_location > &area)
std::set< map_location > area_
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.
editor_action_location_terrain(map_location loc, const t_translation::terrain_code &t)
const std::string & get_name() const override