The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
unit_drawer Class Reference

#include <drawer.hpp>

Public Member Functions

 unit_drawer (display &thedisp)
 
void redraw_unit (const unit &u) const
 draw a unit. More...
 

Private Member Functions

bool selected_or_reachable (const map_location &loc) const
 
void draw_ellipses (const unit &u, const frame_parameters &params) const
 

Private Attributes

displaydisp
 
const display_contextdc
 
const gamemapmap
 
halo::managerhalo_man
 
const teamviewing_team_ref
 
const teamplaying_team_ref
 
bool is_blindfolded
 
bool show_everything
 
map_location sel_hex
 
map_location mouse_hex
 
double zoom_factor
 
std::set< map_locationunits_that_can_reach_goal
 
int hex_size
 
int hex_size_by_2
 

Detailed Description

Definition at line 40 of file drawer.hpp.

Constructor & Destructor Documentation

◆ unit_drawer()

unit_drawer::unit_drawer ( display thedisp)
explicit

Member Function Documentation

◆ draw_ellipses()

void unit_drawer::draw_ellipses ( const unit u,
const frame_parameters params 
) const
private

◆ redraw_unit()

void unit_drawer::redraw_unit ( const unit u) const

draw a unit.


Definition at line 164 of file drawer.cpp.

References allied, unit_animation_component::anim_, unit::anim_comp(), frame_parameters::blend_ratio, frame_parameters::blend_with, blue, unit::can_advance(), unit::can_recruit(), unit_animation_component::clear_haloes(), d, dc, unit::default_anim_image(), disp, unit_animation_component::draw_bars_, draw_ellipses(), display::drawing_buffer_add(), dst, enemy, unit::experience(), unit::facing(), float_to_color(), prefs::get(), unit_type::get_cfg(), map_location::get_direction(), unit::get_hidden(), unit::get_location(), display::get_location(), display::get_location_rect(), image::get_size(), gamemap_base::get_terrain(), gamemap::get_terrain_info(), image::get_texture(), display::get_zoom_factor(), green, frame_parameters::halo_mod, frame_parameters::halo_y, hex_size, frame_parameters::highlight_ratio, unit::hitpoints(), unit::hp_bar_scaling(), unit::hp_color(), frame_parameters::image, frame_parameters::image_mod, unit::image_mods(), unit::incapacitated(), unit::invisible(), is_blindfolded, team::is_enemy(), unit::is_flying(), unit::is_visible_to_team(), unit::leader_crown(), unit::level(), map, display::map_outside_area(), unit::max_experience(), unit::max_hitpoints(), mouse_hex, moved, rect::overlaps(), unit::overlays(), unit::overlays_abilities(), playing_team_ref, unit::poisoned(), frame_parameters::primary_frame, red, unit_animation_component::refreshing_, s, display::scaled_to_zoom(), selected_or_reachable(), unit_animation_component::set_standing(), rect::shifted_by(), show_everything, team::side(), unit::side(), unit::slowed(), frame_parameters::submerge, unit::TC_image_mods(), unit::type(), unit_bar, terrain_type::unit_height_adjust(), display_context::unit_orb_status(), terrain_type::unit_submerge(), viewing_team_ref, unit::xp_bar_scaling(), unit::xp_color(), frame_parameters::y, and zoom_factor.

Referenced by game_display::draw_invalidated().

◆ selected_or_reachable()

bool unit_drawer::selected_or_reachable ( const map_location loc) const
private
Todo:
: better name...

unclear what the reachable part actually means

Definition at line 158 of file drawer.cpp.

References sel_hex, and units_that_can_reach_goal.

Referenced by draw_ellipses(), and redraw_unit().

Member Data Documentation

◆ dc

const display_context& unit_drawer::dc
private

Definition at line 47 of file drawer.hpp.

Referenced by redraw_unit().

◆ disp

display& unit_drawer::disp
private

Definition at line 46 of file drawer.hpp.

Referenced by draw_ellipses(), redraw_unit(), and unit_drawer().

◆ halo_man

halo::manager& unit_drawer::halo_man
private

Definition at line 49 of file drawer.hpp.

◆ hex_size

int unit_drawer::hex_size
private

Definition at line 59 of file drawer.hpp.

Referenced by redraw_unit().

◆ hex_size_by_2

int unit_drawer::hex_size_by_2
private

Definition at line 60 of file drawer.hpp.

Referenced by draw_ellipses().

◆ is_blindfolded

bool unit_drawer::is_blindfolded
private

Definition at line 52 of file drawer.hpp.

Referenced by redraw_unit().

◆ map

const gamemap& unit_drawer::map
private

Definition at line 48 of file drawer.hpp.

Referenced by redraw_unit().

◆ mouse_hex

map_location unit_drawer::mouse_hex
private

Definition at line 55 of file drawer.hpp.

Referenced by redraw_unit().

◆ playing_team_ref

const team& unit_drawer::playing_team_ref
private

Definition at line 51 of file drawer.hpp.

Referenced by redraw_unit().

◆ sel_hex

map_location unit_drawer::sel_hex
private

Definition at line 54 of file drawer.hpp.

Referenced by selected_or_reachable().

◆ show_everything

bool unit_drawer::show_everything
private

Definition at line 53 of file drawer.hpp.

Referenced by redraw_unit().

◆ units_that_can_reach_goal

std::set<map_location> unit_drawer::units_that_can_reach_goal
private

Definition at line 57 of file drawer.hpp.

Referenced by selected_or_reachable(), and unit_drawer().

◆ viewing_team_ref

const team& unit_drawer::viewing_team_ref
private

Definition at line 50 of file drawer.hpp.

Referenced by redraw_unit().

◆ zoom_factor

double unit_drawer::zoom_factor
private

Definition at line 56 of file drawer.hpp.

Referenced by redraw_unit().


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