An image variant. More...
#include <builder.hpp>
Public Member Functions | |
rule_image_variant (const std::string &image_string, const std::string &variations, const std::chrono::milliseconds &random_start=std::chrono::milliseconds{-1}) | |
Constructor for the normal default case. More... | |
rule_image_variant (const std::string &image_string, const std::string &variations, const std::string &tod, const std::string &has_flag, const std::chrono::milliseconds &random_start=std::chrono::milliseconds{-1}) | |
Constructor for true [variant] cases. More... | |
Public Attributes | |
std::string | image_string |
A string representing either the filename for an image, or a list of images, with an optional timing for each image. More... | |
std::string | variations |
A semi-solon separated list of string used to replace. More... | |
std::vector< animated< image::locator > > | images |
An animated image locator built according to the image string. More... | |
std::set< std::string > | tods |
The Time of Day associated to this variant (if any) More... | |
std::vector< std::string > | has_flag |
std::chrono::milliseconds | random_start |
Specify the allowed amount of random shift (in milliseconds) applied to the animation start time, -1 for shifting without limitation. More... | |
An image variant.
The in-memory representation of the [variant] WML tag of the [image] WML tag. When an image only has one variant, the [variant] tag may be omitted.
Definition at line 165 of file builder.hpp.
terrain_builder::rule_image_variant::rule_image_variant | ( | const std::string & | image_string, |
const std::string & | variations, | ||
const std::chrono::milliseconds & | random_start = std::chrono::milliseconds{-1} |
||
) |
Constructor for the normal default case.
Definition at line 648 of file builder.cpp.
terrain_builder::rule_image_variant::rule_image_variant | ( | const std::string & | image_string, |
const std::string & | variations, | ||
const std::string & | tod, | ||
const std::string & | has_flag, | ||
const std::chrono::milliseconds & | random_start = std::chrono::milliseconds{-1} |
||
) |
Constructor for true [variant] cases.
Definition at line 660 of file builder.cpp.
References has_flag, utils::split(), and tods.
std::vector<std::string> terrain_builder::rule_image_variant::has_flag |
Definition at line 212 of file builder.hpp.
Referenced by terrain_builder::tile::rebuild_cache(), and rule_image_variant().
std::string terrain_builder::rule_image_variant::image_string |
A string representing either the filename for an image, or a list of images, with an optional timing for each image.
Corresponds to the "name" parameter of the [variant] (or of the [image]) WML tag.
The timing string is in the following format (expressed in EBNF)
* <timing_string> ::= <timed_image> ( "," <timed_image> ) + * * <timed_image> ::= <image_name> [ ":" <timing> ] * * Where <image_name> represents the actual filename of an image, * and <timing> the number of milliseconds this image will last * in the animation. *
Definition at line 196 of file builder.hpp.
Referenced by terrain_builder::building_rule::get_hash(), terrain_builder::load_images(), and terrain_builder::replace_rotate_tokens().
std::vector<animated<image::locator> > terrain_builder::rule_image_variant::images |
An animated image locator built according to the image string.
This will be the image locator which will actually be returned to the user.
Definition at line 207 of file builder.hpp.
Referenced by terrain_builder::load_images(), gui2::dialogs::terrain_layers::pre_show(), and terrain_builder::tile::rebuild_cache().
std::chrono::milliseconds terrain_builder::rule_image_variant::random_start |
Specify the allowed amount of random shift (in milliseconds) applied to the animation start time, -1 for shifting without limitation.
Definition at line 216 of file builder.hpp.
Referenced by terrain_builder::tile::rebuild_cache().
std::set<std::string> terrain_builder::rule_image_variant::tods |
The Time of Day associated to this variant (if any)
Definition at line 210 of file builder.hpp.
Referenced by terrain_builder::tile::rebuild_cache(), and rule_image_variant().
std::string terrain_builder::rule_image_variant::variations |
A semi-solon separated list of string used to replace.
<code>@V</code>
in image_string (if present)
Definition at line 201 of file builder.hpp.
Referenced by terrain_builder::load_images().