The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Public Attributes | Private Attributes | List of all members
terrain_builder::building_rule Struct Reference

The in-memory representation of a [terrain_graphics] WML rule. More...

Public Member Functions

 building_rule ()
 
bool operator< (const building_rule &that) const
 
unsigned int get_hash () const
 

Public Attributes

constraint_set constraints
 The set of [tile] constraints of this rule. More...
 
map_location location_constraints
 The location on which this map may match. More...
 
map_location modulo_constraints
 Used to constrain locations to ones with coordinates that are multiples of the "mod_x" and "mod_y" parameters. More...
 
int probability
 The probability of this rule to match, when all conditions are met. More...
 
int precedence
 Ordering relation between the rules. More...
 
bool local
 Indicate if the rule is only for this scenario. More...
 

Private Attributes

unsigned int hash_
 

Detailed Description

The in-memory representation of a [terrain_graphics] WML rule.

Definition at line 406 of file builder.hpp.

Constructor & Destructor Documentation

◆ building_rule()

terrain_builder::building_rule::building_rule ( )
inline

Definition at line 408 of file builder.hpp.

Member Function Documentation

◆ get_hash()

unsigned int terrain_builder::building_rule::get_hash ( ) const

◆ operator<()

bool terrain_builder::building_rule::operator< ( const building_rule that) const
inline

Definition at line 455 of file builder.hpp.

References precedence.

Member Data Documentation

◆ constraints

constraint_set terrain_builder::building_rule::constraints

◆ hash_

unsigned int terrain_builder::building_rule::hash_
mutableprivate

Definition at line 463 of file builder.hpp.

◆ local

bool terrain_builder::building_rule::local

Indicate if the rule is only for this scenario.

Definition at line 453 of file builder.hpp.

Referenced by terrain_builder::parse_config().

◆ location_constraints

map_location terrain_builder::building_rule::location_constraints

The location on which this map may match.

Set to a valid map_location if the "x" and "y" parameters of the [terrain_graphics] rule are set.

Definition at line 429 of file builder.hpp.

Referenced by terrain_builder::parse_config(), and terrain_builder::rule_matches().

◆ modulo_constraints

map_location terrain_builder::building_rule::modulo_constraints

Used to constrain locations to ones with coordinates that are multiples of the "mod_x" and "mod_y" parameters.

Doesn't actually refer to a real map location.

Definition at line 436 of file builder.hpp.

Referenced by terrain_builder::parse_config(), and terrain_builder::rule_matches().

◆ precedence

int terrain_builder::building_rule::precedence

Ordering relation between the rules.

Definition at line 448 of file builder.hpp.

Referenced by operator<(), and terrain_builder::parse_config().

◆ probability

int terrain_builder::building_rule::probability

The probability of this rule to match, when all conditions are met.

Defined if the "probability" parameter of the [terrain_graphics] element is set.

Definition at line 443 of file builder.hpp.

Referenced by terrain_builder::parse_config(), and terrain_builder::rule_matches().


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