46 std::unique_ptr<editor_action>
clone()
const override;
77 static const std::string name(
"extendable");
103 std::unique_ptr<editor_action>
clone()
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;
276 std::unique_ptr<editor_action>
clone()
const override;
299 std::unique_ptr<editor_action>
clone()
const override;
321 std::unique_ptr<editor_action>
clone()
const override;
350 std::unique_ptr<editor_action>
clone()
const override;
371 std::unique_ptr<editor_action>
clone()
const override;
387 std::unique_ptr<editor_action>
clone()
const override;
406 std::unique_ptr<editor_action>
clone()
const override;
Base class for editor actions.
std::unique_ptr< editor_action > clone() const override
Action cloning.
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
const std::string & get_name() const override
editor_action_apply_mask(const gamemap &mask)
Base class for area-affecting actions.
const std::string & get_name() const override
editor_action_area(const std::set< map_location > &area)
void extend(const editor_map &map, const std::set< map_location > &locs) override
The crux of the extendable contract.
std::set< map_location > area_
Container action wrapping several actions into one.
std::unique_ptr< editor_action > pop_last_action()
Remove the last added action and return it, transferring ownership to the caller.
const std::string & get_name() const override
editor_action_chain()
Create an empty action chain.
void perform_without_undo(map_context &m) const override
Perform all the actions in order.
std::unique_ptr< editor_action > pop_first_action()
Remove the first added action and return it, transferring ownership to the caller.
~editor_action_chain() override=default
The destructor deletes all the owned action pointers.
editor_action_chain & operator=(const editor_action_chain &other)
void append_action(std::unique_ptr< editor_action > a)
Add an action at the end of the chain.
int action_count() const override
Go through the chain and add up all the action counts.
editor_action_chain(std::deque< std::unique_ptr< editor_action >> actions)
Create an action chain from a deque of action pointers.
std::deque< std::unique_ptr< editor_action > > actions_
The action pointers owned by this action chain.
void prepend_action(std::unique_ptr< editor_action > a)
Add an action at the beginning of the chain.
std::unique_ptr< editor_action > perform(map_context &m) const override
Perform all the actions in order and create a undo action chain.
std::unique_ptr< editor_action > clone() const override
Inherited from editor_action, implemented by IMPLEMENT_ACTION.
std::unique_ptr< editor_action > clone() const override
Action cloning.
editor_action_create_mask(const editor_map &target)
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
const std::string & get_name() const override
Base class for actions that: 1) operate on an area 2) can be used as undo for a click-drag operation ...
virtual void extend(const editor_map &map, const std::set< map_location > &locs)=0
The crux of the extendable contract.
editor_action_extendable()
const std::string & get_name() const override
std::unique_ptr< editor_action > clone() const override
Action cloning.
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
const std::string & get_name() const override
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
editor_action_fill(map_location loc, const t_translation::terrain_code &t, bool one_layer=false)
Base class for actions which in addition to acting on a hex, act with one terrain type,...
editor_action_location_terrain(map_location loc, const t_translation::terrain_code &t)
const std::string & get_name() const override
t_translation::terrain_code t_
Base class for actions which act on a specified location (and possibly on other locations that can be...
editor_action_location(map_location loc)
const std::string & get_name() const override
Paint the same terrain on a number of locations on the map.
const std::string & get_name() const override
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action_paint_area(const std::set< map_location > &area, const t_translation::terrain_code &t, bool one_layer=false)
std::unique_ptr< editor_action > clone() const override
Action cloning.
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
t_translation::terrain_code t_
Paste a map fragment into the map.
void extend(const editor_map &map, const std::set< map_location > &locs) override
The crux of the extendable contract.
const std::string & get_name() const override
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
std::unique_ptr< editor_action > clone() const override
Action cloning.
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action_paste(const map_fragment &paste, const map_location &offset=map_location::ZERO())
const std::string & get_name() const override
t_translation::terrain_code fill_
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
std::unique_ptr< editor_action > clone() const override
Action cloning.
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)
Randomize terrain in an area.
editor_action_shuffle_area(const std::set< map_location > &area)
const std::string & get_name() const override
std::unique_ptr< editor_action > clone() const override
Action cloning.
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
Set starting position action, sets location ids (both for starting locations and for non-starting loc...
editor_action_starting_position(map_location loc, std::string loc_id)
std::unique_ptr< editor_action > clone() const override
Action cloning.
const std::string & get_name() const override
std::unique_ptr< editor_action > perform(map_context &mc) const override
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const override
Perform the action without creating an undo action.
Replace contents of the entire map, Useful as a fallback undo method when something else would be imp...
void perform_without_undo(map_context &m) const override
Perform the action without creating an undo action.
editor_action_whole_map(const editor_map &m)
std::unique_ptr< editor_action > clone() const override
Action cloning.
const std::string & get_name() const override
Base class for all editor actions.
This class adds extra editor-specific functionality to a normal gamemap.
This class wraps around a map to provide a concise interface for the editor to work with.
A map fragment – a collection of locations and information abut them.
Encapsulates the map of the game.
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.
Manage the empty-palette in the editor.
const terrain_code NONE_TERRAIN
Encapsulates the map of the game.
static const map_location & ZERO()
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...