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

Sound source info class. More...

#include <soundsource.hpp>

Public Member Functions

 sourcespec (const std::string &id, const std::string &files, int min_delay, int chance)
 Parameter-list constructor. More...
 
 sourcespec (const config &cfg)
 WML constructor. More...
 
void write (config &cfg) const
 Serializes information into cfg as a new (appended) child of key "sound_source". More...
 
int loops () const
 
void set_loops (int value)
 
bool check_fogged () const
 
bool check_shrouded () const
 
void set_check_fogged (bool value)
 
void set_check_shrouded (bool value)
 
const std::vector< map_location > & get_locations () const
 
int full_range () const
 
void set_full_range (int value)
 
int fade_range () const
 
void set_fade_range (int value)
 
int minimum_delay () const
 
void set_minimum_delay (int value)
 
int chance () const
 
void set_chance (int value)
 
const std::stringid () const
 
const std::stringfiles () const
 

Private Attributes

const std::string id_
 
const std::string files_
 
int min_delay_
 
int chance_
 
int loops_
 
int range_
 
int faderange_
 
bool check_fogged_
 
bool check_shrouded_
 
std::vector< map_locationlocations_
 

Detailed Description

Sound source info class.

Encapsulates sound source parameters, so that they're easier to pass around/extend/read.

Definition at line 114 of file soundsource.hpp.

Constructor & Destructor Documentation

soundsource::sourcespec::sourcespec ( const std::string id,
const std::string files,
int  min_delay,
int  chance 
)
inline

Parameter-list constructor.

Definition at line 132 of file soundsource.hpp.

soundsource::sourcespec::sourcespec ( const config cfg)

WML constructor.

Definition at line 233 of file soundsource.cpp.

References locations_, and read_locations().

Member Function Documentation

int soundsource::sourcespec::chance ( ) const
inline

Definition at line 193 of file soundsource.hpp.

References chance_.

bool soundsource::sourcespec::check_fogged ( ) const
inline

Definition at line 160 of file soundsource.hpp.

References check_fogged_.

bool soundsource::sourcespec::check_shrouded ( ) const
inline

Definition at line 161 of file soundsource.hpp.

References check_shrouded_.

int soundsource::sourcespec::fade_range ( ) const
inline

Definition at line 181 of file soundsource.hpp.

References faderange_.

const std::string& soundsource::sourcespec::files ( ) const
inline

Definition at line 201 of file soundsource.hpp.

References files_.

int soundsource::sourcespec::full_range ( ) const
inline

Definition at line 175 of file soundsource.hpp.

References range_.

const std::vector<map_location>& soundsource::sourcespec::get_locations ( ) const
inline

Definition at line 171 of file soundsource.hpp.

References locations_.

const std::string& soundsource::sourcespec::id ( ) const
inline

Definition at line 199 of file soundsource.hpp.

References id_.

Referenced by soundsource::manager::add().

int soundsource::sourcespec::loops ( ) const
inline

Definition at line 154 of file soundsource.hpp.

References loops_.

int soundsource::sourcespec::minimum_delay ( ) const
inline

Definition at line 187 of file soundsource.hpp.

References min_delay_.

void soundsource::sourcespec::set_chance ( int  value)
inline

Definition at line 195 of file soundsource.hpp.

void soundsource::sourcespec::set_check_fogged ( bool  value)
inline

Definition at line 163 of file soundsource.hpp.

void soundsource::sourcespec::set_check_shrouded ( bool  value)
inline

Definition at line 167 of file soundsource.hpp.

void soundsource::sourcespec::set_fade_range ( int  value)
inline

Definition at line 183 of file soundsource.hpp.

void soundsource::sourcespec::set_full_range ( int  value)
inline

Definition at line 177 of file soundsource.hpp.

void soundsource::sourcespec::set_loops ( int  value)
inline

Definition at line 156 of file soundsource.hpp.

void soundsource::sourcespec::set_minimum_delay ( int  value)
inline

Definition at line 189 of file soundsource.hpp.

void soundsource::sourcespec::write ( config cfg) const

Serializes information into cfg as a new (appended) child of key "sound_source".

Member Data Documentation

int soundsource::sourcespec::chance_
private

Definition at line 120 of file soundsource.hpp.

Referenced by chance().

bool soundsource::sourcespec::check_fogged_
private

Definition at line 125 of file soundsource.hpp.

Referenced by check_fogged().

bool soundsource::sourcespec::check_shrouded_
private

Definition at line 126 of file soundsource.hpp.

Referenced by check_shrouded().

int soundsource::sourcespec::faderange_
private

Definition at line 124 of file soundsource.hpp.

Referenced by fade_range().

const std::string soundsource::sourcespec::files_
private

Definition at line 117 of file soundsource.hpp.

Referenced by files().

const std::string soundsource::sourcespec::id_
private

Definition at line 116 of file soundsource.hpp.

Referenced by id().

std::vector<map_location> soundsource::sourcespec::locations_
private

Definition at line 128 of file soundsource.hpp.

Referenced by get_locations(), and sourcespec().

int soundsource::sourcespec::loops_
private

Definition at line 122 of file soundsource.hpp.

Referenced by loops().

int soundsource::sourcespec::min_delay_
private

Definition at line 119 of file soundsource.hpp.

Referenced by minimum_delay().

int soundsource::sourcespec::range_
private

Definition at line 123 of file soundsource.hpp.

Referenced by full_range().


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