Represents a tile of the game map, with all associated builder-specific parameters: flags, images attached to this tile, etc. More...
#include <builder.hpp>
Classes | |
| struct | rule_image_rand |
| Represent a rule_image applied with a random seed. More... | |
Public Types | |
| typedef std::pair< const rule_image_rand *, const rule_image_variant * > | log_details |
| typedef std::vector< log_details > | logs |
Public Member Functions | |
| void | rebuild_cache (const std::string &tod, logs *log=nullptr) |
| Rebuilds the whole image cache, for a given time-of-day. | |
| void | clear () |
| Clears all data in this tile, and resets the cache. | |
Public Attributes | |
| std::set< std::string > | flags |
| The list of flags present in this tile. | |
| std::vector< rule_image_rand > | images |
| The list of rule_images and random seeds associated to this tile. | |
| imagelist | images_foreground |
| The list of images which are in front of the unit sprites, attached to this tile. | |
| imagelist | images_background |
| The list of images which are behind the unit sprites, attached to this tile. | |
| std::string | last_tod = "invalid_tod" |
| The time-of-day to which the image caches correspond. | |
| bool | sorted_images = false |
| Indicates if 'images' is sorted. | |
Represents a tile of the game map, with all associated builder-specific parameters: flags, images attached to this tile, etc.
An array of those tiles is built when terrains are built either during construction, or upon calling the rebuild_all() method.
Definition at line 284 of file builder.hpp.
| typedef std::pair<const rule_image_rand*, const rule_image_variant*> terrain_builder::tile::log_details |
Definition at line 287 of file builder.hpp.
| typedef std::vector<log_details> terrain_builder::tile::logs |
Definition at line 288 of file builder.hpp.
| void terrain_builder::tile::clear | ( | ) |
Clears all data in this tile, and resets the cache.
Definition at line 168 of file builder.cpp.
Rebuilds the whole image cache, for a given time-of-day.
This file holds the terrain_builder implementation.
Must be called when the time-of-day has changed, to select the correct images.
| tod | The current time-of-day |
| log |
Definition at line 92 of file builder.cpp.
References flags, prefs::get(), i, images, images_background, images_foreground, image::is_empty_hex(), terrain_builder::map(), s, and sorted_images.
| std::set<std::string> terrain_builder::tile::flags |
The list of flags present in this tile.
Definition at line 302 of file builder.hpp.
Referenced by gui2::dialogs::terrain_layers::pre_show(), and rebuild_cache().
| std::vector<rule_image_rand> terrain_builder::tile::images |
The list of rule_images and random seeds associated to this tile.
Definition at line 323 of file builder.hpp.
Referenced by rebuild_cache().
| imagelist terrain_builder::tile::images_background |
The list of images which are behind the unit sprites, attached to this tile.
This member is considered a cache: it is built once, and on-demand.
Definition at line 334 of file builder.hpp.
Referenced by rebuild_cache().
| imagelist terrain_builder::tile::images_foreground |
The list of images which are in front of the unit sprites, attached to this tile.
This member is considered a cache: it is built once, and on-demand.
Definition at line 329 of file builder.hpp.
Referenced by rebuild_cache().
| std::string terrain_builder::tile::last_tod = "invalid_tod" |
The time-of-day to which the image caches correspond.
Definition at line 338 of file builder.hpp.
Indicates if 'images' is sorted.
Definition at line 341 of file builder.hpp.
Referenced by rebuild_cache().