Public Member Functions | Protected Attributes

editor::editor_action_paste Class Reference

Paste a map fragment into the map. More...

#include <action.hpp>

Inheritance diagram for editor::editor_action_paste:
Inheritance graph
[legend]
Collaboration diagram for editor::editor_action_paste:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 editor_action_paste (const map_fragment &paste, const map_location &offset=map_location(0, 0))
editor_action_pasteclone () const
 Action cloning.
editor_action_pasteperform (map_context &mc) const
 Perform the action, returning an undo action that, when performed, shall reverse any effects of this action.
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.
const char * get_name () const

Protected Attributes

map_location offset_
map_fragment paste_

Detailed Description

Paste a map fragment into the map.

No offset is used.

Definition at line 225 of file action.hpp.


Constructor & Destructor Documentation

editor::editor_action_paste::editor_action_paste ( const map_fragment paste,
const map_location offset = map_location(0,0) 
) [inline]

Definition at line 228 of file action.hpp.

Referenced by perform_without_undo().

Here is the caller graph for this function:


Member Function Documentation

editor_action_paste * editor::editor_action_paste::clone (  )  const [virtual]

Action cloning.

Implements editor::editor_action.

Definition at line 154 of file action.cpp.

References editor::editor_action_area::area_.

void editor::editor_action_paste::extend ( const editor_map map,
const std::set< map_location > &  locs 
) [virtual]

The crux of the extendable contract.

This member function must be implemented so that the undo behaviour is consistent, exactly the same as would be with separate undo actions for every part of the drag.

Implements editor::editor_action_extendable.

Definition at line 158 of file action.cpp.

const char* editor::editor_action_paste::get_name (  )  const [inline, virtual]
Returns:
a short name of this action type, defaults to unknown

Reimplemented from editor::editor_action_extendable.

Definition at line 236 of file action.hpp.

editor_action_paste * editor::editor_action_paste::perform ( map_context mc  )  const [virtual]

Perform the action, returning an undo action that, when performed, shall reverse any effects of this action.

The undo action object is owned by the caller. Default behaviour is to create a whole-map undo, call the perform_without_undo function and return the undo object.

Reimplemented from editor::editor_action.

Definition at line 162 of file action.cpp.

void editor::editor_action_paste::perform_without_undo ( map_context  )  const [virtual]

Perform the action without creating an undo action.

Implements editor::editor_action.

Definition at line 169 of file action.cpp.

References editor_action_paste(), editor::map_fragment::get_offset_area(), offset_, and paste_.

Here is the call graph for this function:


Member Data Documentation

Definition at line 238 of file action.hpp.

Referenced by perform_without_undo().

Definition at line 239 of file action.hpp.

Referenced by perform_without_undo().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:25 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs