The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
terrain_builder::rule_image_variant Struct Reference

An image variant. More...

#include <builder.hpp>

Public Member Functions

 rule_image_variant (const std::string &image_string, const std::string &variations, bool random_start=true)
 Constructor for the normal defaut case. More...
 
 rule_image_variant (const std::string &image_string, const std::string &variations, const std::string &tod, const std::string &has_flag, bool random_start=true)
 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::stringtods
 The Time of Day associated to this variant (if any) More...
 
std::vector< std::stringhas_flag
 
bool random_start
 Indicate if the animation uses a random shift. More...
 

Detailed Description

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 153 of file builder.hpp.

Constructor & Destructor Documentation

terrain_builder::rule_image_variant::rule_image_variant ( const std::string image_string,
const std::string variations,
bool  random_start = true 
)
inline

Constructor for the normal defaut case.

Definition at line 155 of file builder.hpp.

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,
bool  random_start = true 
)

Constructor for true [variant] cases.

Definition at line 660 of file builder.cpp.

References utils::split(), and tods.

Member Data Documentation

std::vector<std::string> terrain_builder::rule_image_variant::has_flag

Definition at line 200 of file builder.hpp.

Referenced by terrain_builder::tile::rebuild_cache().

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 184 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 195 of file builder.hpp.

Referenced by events::console_handler::do_layers(), terrain_builder::load_images(), and terrain_builder::tile::rebuild_cache().

bool terrain_builder::rule_image_variant::random_start

Indicate if the animation uses a random shift.

Definition at line 203 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 198 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 189 of file builder.hpp.

Referenced by terrain_builder::load_images().


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