map_editor::map_undo_action Class Reference

A saved action that may be undone. More...

#include <editor_undo.hpp>

List of all members.

Public Member Functions

 map_undo_action ()
const std::map
< gamemap::location,
t_translation::t_terrain > & 
undo_terrains () const
const std::map
< gamemap::location,
t_translation::t_terrain > & 
redo_terrains () const
const std::set< gamemap::locationundo_selection () const
const std::set< gamemap::locationredo_selection () const
std::string new_map_data () const
std::string old_map_data () const
const std::map
< gamemap::location, int > & 
undo_starting_locations () const
const std::map
< gamemap::location, int > & 
redo_starting_locations () const
void add_terrain (const t_translation::t_terrain &old_tr, const t_translation::t_terrain &new_tr, const gamemap::location &lc)
bool terrain_set () const
 Return true if a terrain change has been saved in this undo action.
void set_selection (const std::set< gamemap::location > &old_selection, const std::set< gamemap::location > &new_selection)
bool selection_set () const
 Return true if a selection change has been saved in this undo action.
void set_map_data (const std::string &old_data, const std::string &new_data)
bool map_data_set () const
 Return true if a map data change has been saved in this undo action.
void add_starting_location (const int old_side, const int new_side, const gamemap::location &old_loc, const gamemap::location &new_loc)
bool starting_location_set () const
 Return true if starting locations have been saved in this undo action.
bool something_set () const
 Return true if something have been saved in this undo.

Private Attributes

std::map< gamemap::location,
t_translation::t_terrain
old_terrain_
std::map< gamemap::location,
t_translation::t_terrain
new_terrain_
bool terrain_set_
std::set< gamemap::locationold_selection_
std::set< gamemap::locationnew_selection_
bool selection_set_
std::string old_map_data_
std::string new_map_data_
bool map_data_set_
std::map< gamemap::location, int > old_starting_locations_
std::map< gamemap::location, int > new_starting_locations_
bool starting_locations_set_


Detailed Description

A saved action that may be undone.

Definition at line 35 of file editor_undo.hpp.


Constructor & Destructor Documentation

map_editor::map_undo_action::map_undo_action (  ) 

Definition at line 29 of file editor_undo.cpp.

References map_data_set_, selection_set_, starting_locations_set_, and terrain_set_.


Member Function Documentation

const std::map< gamemap::location, t_translation::t_terrain > & map_editor::map_undo_action::undo_terrains (  )  const

Definition at line 36 of file editor_undo.cpp.

References old_terrain_.

Referenced by map_editor::undo().

const std::map< gamemap::location, t_translation::t_terrain > & map_editor::map_undo_action::redo_terrains (  )  const

Definition at line 41 of file editor_undo.cpp.

References new_terrain_.

Referenced by map_editor::redo().

const std::set< gamemap::location > map_editor::map_undo_action::undo_selection (  )  const

Definition at line 46 of file editor_undo.cpp.

References old_selection_.

Referenced by map_editor::undo().

const std::set< gamemap::location > map_editor::map_undo_action::redo_selection (  )  const

Definition at line 50 of file editor_undo.cpp.

References new_selection_.

Referenced by map_editor::redo().

std::string map_editor::map_undo_action::new_map_data (  )  const

Definition at line 58 of file editor_undo.cpp.

References new_map_data_.

Referenced by map_editor::redo().

std::string map_editor::map_undo_action::old_map_data (  )  const

Definition at line 54 of file editor_undo.cpp.

References old_map_data_.

Referenced by map_editor::undo().

const std::map< gamemap::location, int > & map_editor::map_undo_action::undo_starting_locations (  )  const

Definition at line 62 of file editor_undo.cpp.

References old_starting_locations_.

Referenced by map_editor::undo().

const std::map< gamemap::location, int > & map_editor::map_undo_action::redo_starting_locations (  )  const

Definition at line 66 of file editor_undo.cpp.

References new_starting_locations_.

Referenced by map_editor::redo().

void map_editor::map_undo_action::add_terrain ( const t_translation::t_terrain old_tr,
const t_translation::t_terrain new_tr,
const gamemap::location lc 
)

bool map_editor::map_undo_action::terrain_set (  )  const

Return true if a terrain change has been saved in this undo action.

Definition at line 79 of file editor_undo.cpp.

References terrain_set_.

Referenced by map_editor::redo(), and map_editor::undo().

void map_editor::map_undo_action::set_selection ( const std::set< gamemap::location > &  old_selection,
const std::set< gamemap::location > &  new_selection 
)

Definition at line 83 of file editor_undo.cpp.

References new_selection_, old_selection_, and selection_set_.

Referenced by map_editor::paste_buffer().

bool map_editor::map_undo_action::selection_set (  )  const

Return true if a selection change has been saved in this undo action.

Definition at line 90 of file editor_undo.cpp.

References selection_set_.

Referenced by map_editor::redo(), and map_editor::undo().

void map_editor::map_undo_action::set_map_data ( const std::string &  old_data,
const std::string &  new_data 
)

bool map_editor::map_undo_action::map_data_set (  )  const

Return true if a map data change has been saved in this undo action.

Definition at line 101 of file editor_undo.cpp.

References map_data_set_.

Referenced by map_editor::redo(), and map_editor::undo().

void map_editor::map_undo_action::add_starting_location ( const int  old_side,
const int  new_side,
const gamemap::location old_loc,
const gamemap::location new_loc 
)

bool map_editor::map_undo_action::starting_location_set (  )  const

Return true if starting locations have been saved in this undo action.

Definition at line 113 of file editor_undo.cpp.

References starting_locations_set_.

Referenced by map_editor::redo(), and map_editor::undo().

bool map_editor::map_undo_action::something_set (  )  const

Return true if something have been saved in this undo.

Definition at line 117 of file editor_undo.cpp.

References map_data_set_, selection_set_, starting_locations_set_, and terrain_set_.

Referenced by map_editor::save_undo_action().


Member Data Documentation

Definition at line 85 of file editor_undo.hpp.

Referenced by add_terrain(), and undo_terrains().

Definition at line 86 of file editor_undo.hpp.

Referenced by add_terrain(), and redo_terrains().

Definition at line 87 of file editor_undo.hpp.

Referenced by add_terrain(), map_undo_action(), something_set(), and terrain_set().

Definition at line 88 of file editor_undo.hpp.

Referenced by set_selection(), and undo_selection().

Definition at line 89 of file editor_undo.hpp.

Referenced by redo_selection(), and set_selection().

Definition at line 90 of file editor_undo.hpp.

Referenced by map_undo_action(), selection_set(), set_selection(), and something_set().

Definition at line 91 of file editor_undo.hpp.

Referenced by old_map_data(), and set_map_data().

Definition at line 92 of file editor_undo.hpp.

Referenced by new_map_data(), and set_map_data().

Definition at line 93 of file editor_undo.hpp.

Referenced by map_data_set(), map_undo_action(), set_map_data(), and something_set().

Definition at line 94 of file editor_undo.hpp.

Referenced by add_starting_location(), and undo_starting_locations().

Definition at line 95 of file editor_undo.hpp.

Referenced by add_starting_location(), and redo_starting_locations().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs