Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

battle_prediction_pane Class Reference

#include <attack_prediction_display.hpp>

Inheritance diagram for battle_prediction_pane:
Inheritance graph
[legend]
Collaboration diagram for battle_prediction_pane:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 battle_prediction_pane (const battle_context &bc, const map_location &attacker_loc, const map_location &defender_loc)
void draw_contents ()
bool left_side () const
void set_selection (int)

Private Member Functions

void get_unit_strings (const battle_context_unit_stats &stats, const unit &u, const map_location &u_loc, float u_unscathed, const unit &opp, const map_location &opp_loc, const attack_type *opp_weapon, std::vector< std::string > &left_strings, std::vector< std::string > &right_strings, int &left_strings_width, int &right_strings_width, int &strings_width)
int get_strings_max_length (const std::vector< std::string > &strings)
void get_hp_prob_vector (const std::vector< double > &hp_dist, std::vector< std::pair< int, double > > &hp_prob_vector)
void draw_unit (int x_off, int damage_line_skip, int left_strings_width, const std::vector< std::string > &left_strings, const std::vector< std::string > &right_strings, const std::string &label, int label_width, surface &hp_distrib, int hp_distrib_width)
void get_hp_distrib_surface (const std::vector< std::pair< int, double > > &hp_prob_vector, const battle_context_unit_stats &stats, const battle_context_unit_stats &opp_stats, surface &surf, int &width, int &height)
Uint32 blend_rgb (const surface &surf, unsigned char r, unsigned char g, unsigned char b, unsigned char drop)

Private Attributes

const battle_contextbc_
const map_locationattacker_loc_
const map_locationdefender_loc_
const unitattacker_
const unitdefender_
std::string attacker_label_
std::string defender_label_
int attacker_label_width_
int defender_label_width_
std::vector< std::string > attacker_left_strings_
std::vector< std::string > attacker_right_strings_
std::vector< std::string > defender_left_strings_
std::vector< std::string > defender_right_strings_
int attacker_strings_width_
int attacker_left_strings_width_
int attacker_right_strings_width_
int defender_strings_width_
int defender_left_strings_width_
int defender_right_strings_width_
int units_strings_height_
std::string hp_distrib_string_
surface attacker_hp_distrib_
surface defender_hp_distrib_
int hp_distrib_string_width_
int attacker_hp_distrib_width_
int defender_hp_distrib_width_
int attacker_hp_distrib_height_
int defender_hp_distrib_height_
int hp_distribs_height_
int attacker_width_
int defender_width_
int units_width_
int dialog_width_
int dialog_height_

Static Private Attributes

static const int inter_line_gap_ = 3
static const int inter_column_gap_ = 30
static const int inter_units_gap_ = 30
static const int max_hp_distrib_rows_ = 10

Detailed Description

Definition at line 24 of file attack_prediction_display.hpp.


Constructor & Destructor Documentation

battle_prediction_pane::battle_prediction_pane ( const battle_context bc,
const map_location attacker_loc,
const map_location defender_loc 
)

Member Function Documentation

Uint32 battle_prediction_pane::blend_rgb ( const surface surf,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  drop 
) [private]

Definition at line 525 of file attack_prediction_display.cpp.

Referenced by get_hp_distrib_surface().

Here is the caller graph for this function:

void battle_prediction_pane::draw_contents (  )  [virtual]
void battle_prediction_pane::draw_unit ( int  x_off,
int  damage_line_skip,
int  left_strings_width,
const std::vector< std::string > &  left_strings,
const std::vector< std::string > &  right_strings,
const std::string &  label,
int  label_width,
surface hp_distrib,
int  hp_distrib_width 
) [private]
void battle_prediction_pane::get_hp_distrib_surface ( const std::vector< std::pair< int, double > > &  hp_prob_vector,
const battle_context_unit_stats stats,
const battle_context_unit_stats opp_stats,
surface surf,
int &  width,
int &  height 
) [private]
void battle_prediction_pane::get_hp_prob_vector ( const std::vector< double > &  hp_dist,
std::vector< std::pair< int, double > > &  hp_prob_vector 
) [private]

Definition at line 292 of file attack_prediction_display.cpp.

References max_hp_distrib_rows_, and sort().

Referenced by battle_prediction_pane().

Here is the call graph for this function:

Here is the caller graph for this function:

int battle_prediction_pane::get_strings_max_length ( const std::vector< std::string > &  strings  )  [private]

Definition at line 282 of file attack_prediction_display.cpp.

References font::line_width(), and font::SIZE_NORMAL.

Referenced by get_unit_strings().

Here is the call graph for this function:

Here is the caller graph for this function:

void battle_prediction_pane::get_unit_strings ( const battle_context_unit_stats stats,
const unit u,
const map_location u_loc,
float  u_unscathed,
const unit opp,
const map_location opp_loc,
const attack_type opp_weapon,
std::vector< std::string > &  left_strings,
std::vector< std::string > &  right_strings,
int &  left_strings_width,
int &  right_strings_width,
int &  strings_width 
) [private]
bool battle_prediction_pane::left_side (  )  const [inline, virtual]

Implements gui::preview_pane.

Definition at line 36 of file attack_prediction_display.hpp.

void battle_prediction_pane::set_selection ( int   )  [inline, virtual]

Implements gui::preview_pane.

Definition at line 39 of file attack_prediction_display.hpp.


Member Data Documentation

Definition at line 45 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 65 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 68 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 67 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 55 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 56 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

std::vector<std::string> battle_prediction_pane::attacker_left_strings_ [private]

Definition at line 58 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 60 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 43 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

std::vector<std::string> battle_prediction_pane::attacker_right_strings_ [private]

Definition at line 58 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 60 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 60 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 70 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 42 of file attack_prediction_display.hpp.

Definition at line 46 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 65 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 68 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 67 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 55 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 56 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

std::vector<std::string> battle_prediction_pane::defender_left_strings_ [private]

Definition at line 59 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 61 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 44 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

std::vector<std::string> battle_prediction_pane::defender_right_strings_ [private]

Definition at line 59 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

Definition at line 61 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 61 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 70 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 71 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 71 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 64 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_unit().

Definition at line 66 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_unit().

Definition at line 68 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

const int battle_prediction_pane::inter_column_gap_ = 30 [static, private]

Definition at line 50 of file attack_prediction_display.hpp.

Referenced by draw_unit(), and get_unit_strings().

const int battle_prediction_pane::inter_line_gap_ = 3 [static, private]

Definition at line 49 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_unit().

const int battle_prediction_pane::inter_units_gap_ = 30 [static, private]

Definition at line 51 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), and draw_contents().

const int battle_prediction_pane::max_hp_distrib_rows_ = 10 [static, private]

Definition at line 52 of file attack_prediction_display.hpp.

Referenced by get_hp_prob_vector().

Definition at line 62 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane().

Definition at line 70 of file attack_prediction_display.hpp.

Referenced by battle_prediction_pane(), draw_contents(), and draw_unit().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:11 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs