26 #ifndef EDITOR_ACTION_HPP
27 #define EDITOR_ACTION_HPP
47 const char*
get_name()
const {
return "whole_map"; }
70 virtual void extend(
const editor_map& map,
const std::set<map_location>& locs) = 0;
71 const char*
get_name()
const {
return "extendable"; }
184 const char*
get_name()
const {
return "location"; }
200 const char*
get_name()
const {
return "location_terrain"; }
255 const char*
get_name()
const {
return "paint_area"; }
293 const char*
get_name()
const {
return "starting_pos"; }
332 const char*
get_name()
const {
return "apply_mask"; }
346 const char*
get_name()
const {
return "create_mask"; }
364 const char*
get_name()
const {
return "shuffle_area"; }
t_translation::t_terrain t_
Randomize terrain in an area.
A map fragment – a collection of locations and information abut them.
const char * get_name() const
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
void append_action(editor_action *a)
Add an action at the end of the chain.
virtual void extend(const editor_map &map, const std::set< map_location > &locs)=0
The crux of the extendable contract.
const char * get_name() const
const t_terrain NONE_TERRAIN
Base class for actions which act on a specified location (and possibly on other locations that can be...
const char * get_name() const
editor_action_shuffle_area * clone() const
Action cloning.
editor_action_chain * perform(map_context &m) const
Perform all the actions in order and create a undo action chain.
static const map_location & ZERO()
Old implementation:
editor_action_paste * clone() const
Action cloning.
editor_action_chain & operator=(const editor_action_chain &other)
Base class for area-affecting actions.
const char * get_name() const
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
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 * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action_paint_area * clone() const
Action cloning.
editor_action_create_mask(const editor_map &target)
Set starting position action.
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
const char * get_name() const
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
void perform_without_undo(map_context &m) const
Perform the action without creating an undo action.
editor_action_paint_area(const std::set< map_location > &area, const t_translation::t_terrain &t, bool one_layer=false)
const char * get_name() const
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
void extend(const editor_map &map, const std::set< map_location > &locs)
The crux of the extendable contract.
editor_action * pop_first_action()
Remove the first added action and return it, transferring ownership to the caller.
GLboolean GLboolean GLboolean GLboolean a
void extend(const editor_map &map, const std::set< map_location > &locs)
The crux of the extendable contract.
Encapsulates the map of the game.
editor_action_apply_mask(const gamemap &mask)
editor_action_paste * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
t_translation::t_terrain t_
std::deque< editor_action * > actions_
The action pointers owned by this action chain.
editor_action * pop_last_action()
Remove the last added action and return it, transferring ownership to the caller. ...
Base class for actions which in addition to acting on a hex, act with one terrain type...
Manage the empty-palette in the editor.
const char * get_name() const
Paint the same terrain on a number of locations on the map.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
editor_action_shuffle_area(const std::set< map_location > &area)
Encapsulates the map of the game.
editor_action_whole_map(const editor_map &m)
const char * get_name() const
const char * get_name() const
t_translation::t_terrain fill_
editor_action_location(map_location loc)
editor_action_apply_mask * clone() const
Action cloning.
editor_action_fill(map_location loc, const t_translation::t_terrain &t, bool one_layer=false)
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())
editor_action_paste * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
int action_count() const
Go through the chain and add up all the action counts.
const char * get_name() const
editor_action_chain(std::deque< editor_action * > actions)
Create an action chain from a deque of action pointers.
Base class for all editor actions.
void prepend_action(editor_action *a)
Add an action at the beginning of the chain.
editor_action_whole_map * clone() const
Action cloning.
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...
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
editor_action_paint_area * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
editor_action_paste * perform(map_context &mc) const
Perform the action, returning an undo action that, when performed, shall reverse any effects of this ...
void perform_without_undo(map_context &mc) const
Perform the action without creating an undo action.
editor_action_starting_position * clone() const
Action cloning.
editor_action_extendable()
editor_action_resize_map(int x_size, int y_size, int x_offset, int y_offset, const t_translation::t_terrain &fill=t_translation::NONE_TERRAIN)
editor_action_fill * clone() const
Action cloning.
~editor_action_chain()
The destructor deletes all the owned action pointers.
editor_action_chain()
Create an empty action chain.
void perform_without_undo(map_context &m) const
Perform all the actions in order.
const char * get_name() const
editor_action_area(const std::set< map_location > &area)
editor_action_create_mask * clone() const
Action cloning.
editor_action_resize_map * clone() const
Action cloning.
std::set< map_location > area_
const char * get_name() const
editor_action_location_terrain(map_location loc, const t_translation::t_terrain &t)
GLsizei const GLcharARB ** string
editor_action_chain * clone() const
Action cloning.
const char * get_name() const
const char * get_name() const
editor_action_chain(editor_action *action)
Create an action chain by wrapping around a single action pointer.