15 #ifndef EDITOR_MAP_FRAGMENT_HPP_INCLUDED
16 #define EDITOR_MAP_FRAGMENT_HPP_INCLUDED
33 : offset(offset),
terrain(map.get_terrain(offset))
75 std::set<map_location>
get_area()
const;
A map fragment – a collection of locations and information abut them.
void flip_horizontal()
Flip the map fragment horizontally.
void paste_into(gamemap &map, const map_location &loc) const
Paste the map fragment into the map, treating loc as the (0,0) point (offset).
std::string dump() const
Debug dump to a string.
void rotate_60_ccw()
Rotate the map fragment 60 degrees counter-clockwise around (0,0)
std::set< map_location > get_offset_area(const map_location &offset) const
Get the area covered by this map fragment, shifted by an offset.
Encapsulates the map of the game.
Manage the empty-palette in the editor.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
Encapsulates the map of the game.
void flip_vertical()
Flip the map fragment vertically.
void shift(const map_location &offset)
Shift all tiles in the map fragment by the specified offset.
map_location center_of_mass() const
Get the center of the map fragment, mass-wise.
const std::vector< tile_info > & get_items() const
Get the tile_info vector.
This represents a tile along with information about it, namely the terrain, possibly other informatio...
t_translation::t_terrain terrain
void add_tiles(const gamemap &map, const std::set< map_location > &loc)
Add many locations and pull their info from the map.
map_fragment()
Create an empty map fragment.
std::set< map_location > area_
tile_info(const gamemap &map, const map_location &offset)
Create a tile info – the constructor grabs required data from the map.
std::set< map_location > get_area() const
Get the area covered by this map fragment.
std::vector< tile_info > items_
The data of this map_fragment.
void center_by_mass()
Shift the map fragment so it is roughly centered around the (0,0) point, mass-wise.
GLsizei const GLcharARB ** string
void add_tile(const gamemap &map, const map_location &loc)
Add a single location and pull its info from the map.
void rotate_60_cw()
Rotate the map fragment 60 degrees clockwise around (0,0)