Symphony Of Empires
Map Class Reference

#include <map.hpp>

Collaboration diagram for Map:

Public Member Functions

 Map (GameState &gs, const World &world, UI::Group *map_ui_layer, int screen_width, int screen_height)
 
 ~Map ()
 
void update_mapmode ()
 
void draw_flag (const Eng3D::OpenGL::Program &shader, const Nation &nation)
 
void draw ()
 
void set_map_mode (mapmode_generator mapmode_func, mapmode_tooltip tooltip_func)
 
void set_selected_province (bool selected, ProvinceId id)
 
void set_view (MapView view)
 
void reload_shaders ()
 
void update_nation_label (const Nation &nation)
 
void create_labels ()
 
void handle_resize ()
 
void handle_mouse_button (const Eng3D::Event::MouseButton &e)
 
void handle_mouse_motions (const Eng3D::Event::MouseMotion &e)
 
void set_selection (selector_func selector)
 

Public Attributes

bool province_selected = false
 
ProvinceId selected_province_id
 
MapView view_mode = MapView::PLANE_VIEW
 
std::vector< std::shared_ptr< Eng3D::Model > > building_type_models
 
std::vector< std::shared_ptr< Eng3D::Model > > unit_type_models
 
std::vector< std::shared_ptr< Eng3D::Model > > tree_type_models
 
std::vector< glm::vec2 > tree_spawn_pos
 
std::vector< std::shared_ptr< Eng3D::Texture > > building_type_icons
 
std::vector< std::shared_ptr< Eng3D::Texture > > unit_type_icons
 
std::vector< std::shared_ptr< Eng3D::Texture > > nation_flags
 
std::vector< std::unique_ptr< Eng3D::Label3D > > province_labels
 
std::vector< std::unique_ptr< Eng3D::Label3D > > nation_labels
 
bool gen_labels = true
 
float wind_osc = 0.f
 Wind oscillator (for flags) More...
 
bool is_drag = false
 Input states. More...
 
glm::vec2 last_camera_drag_pos
 
const Worldworld
 
UI::Tooltiptooltip = nullptr
 
UI::Groupmap_ui_layer = nullptr
 
std::unique_ptr< Eng3D::Cameracamera
 
std::unique_ptr< MapRendermap_render
 
std::vector< Interface::UnitWidget * > unit_widgets
 
std::vector< Interface::BattleWidget * > battle_widgets
 
std::unique_ptr< Eng3D::OpenGL::Programobj_shader
 

Detailed Description

Definition at line 89 of file map.hpp.

Constructor & Destructor Documentation

◆ Map()

Map::Map ( GameState gs,
const World world,
UI::Group map_ui_layer,
int  screen_width,
int  screen_height 
)

Definition at line 118 of file map.cpp.

Here is the call graph for this function:

◆ ~Map()

Map::~Map ( )

Definition at line 163 of file map.cpp.

Member Function Documentation

◆ create_labels()

void Map::create_labels ( )

Definition at line 225 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw()

void Map::draw ( )
Todo:
We need to better this

Definition at line 414 of file map.cpp.

Here is the call graph for this function:

◆ draw_flag()

void Map::draw_flag ( const Eng3D::OpenGL::Program shader,
const Nation nation 
)

Definition at line 337 of file map.cpp.

Here is the call graph for this function:

◆ handle_mouse_button()

void Map::handle_mouse_button ( const Eng3D::Event::MouseButton e)

Definition at line 599 of file map.cpp.

Here is the call graph for this function:

◆ handle_mouse_motions()

void Map::handle_mouse_motions ( const Eng3D::Event::MouseMotion e)

Definition at line 623 of file map.cpp.

Here is the call graph for this function:

◆ handle_resize()

void Map::handle_resize ( )

Definition at line 519 of file map.cpp.

◆ reload_shaders()

void Map::reload_shaders ( )

Definition at line 281 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_map_mode()

void Map::set_map_mode ( mapmode_generator  mapmode_func,
mapmode_tooltip  tooltip_func 
)

Definition at line 325 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_selected_province()

void Map::set_selected_province ( bool  selected,
ProvinceId  id 
)

Definition at line 331 of file map.cpp.

◆ set_selection()

void Map::set_selection ( selector_func  selector)

Definition at line 321 of file map.cpp.

◆ set_view()

void Map::set_view ( MapView  view)

Definition at line 254 of file map.cpp.

◆ update_mapmode()

void Map::update_mapmode ( )

Definition at line 362 of file map.cpp.

Here is the caller graph for this function:

◆ update_nation_label()

void Map::update_nation_label ( const Nation nation)

Definition at line 167 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ battle_widgets

std::vector<Interface::BattleWidget*> Map::battle_widgets

Definition at line 154 of file map.hpp.

◆ building_type_icons

std::vector<std::shared_ptr<Eng3D::Texture> > Map::building_type_icons

Definition at line 129 of file map.hpp.

◆ building_type_models

std::vector<std::shared_ptr<Eng3D::Model> > Map::building_type_models

Definition at line 125 of file map.hpp.

◆ camera

std::unique_ptr<Eng3D::Camera> Map::camera

Definition at line 151 of file map.hpp.

◆ gen_labels

bool Map::gen_labels = true

Definition at line 137 of file map.hpp.

◆ is_drag

bool Map::is_drag = false

Input states.

Definition at line 142 of file map.hpp.

◆ last_camera_drag_pos

glm::vec2 Map::last_camera_drag_pos

Definition at line 143 of file map.hpp.

◆ map_render

std::unique_ptr<MapRender> Map::map_render

Definition at line 152 of file map.hpp.

◆ map_ui_layer

UI::Group* Map::map_ui_layer = nullptr

Definition at line 149 of file map.hpp.

◆ nation_flags

std::vector<std::shared_ptr<Eng3D::Texture> > Map::nation_flags

Definition at line 131 of file map.hpp.

◆ nation_labels

std::vector<std::unique_ptr<Eng3D::Label3D> > Map::nation_labels

Definition at line 136 of file map.hpp.

◆ obj_shader

std::unique_ptr<Eng3D::OpenGL::Program> Map::obj_shader

Definition at line 155 of file map.hpp.

◆ province_labels

std::vector<std::unique_ptr<Eng3D::Label3D> > Map::province_labels

Definition at line 134 of file map.hpp.

◆ province_selected

bool Map::province_selected = false

Definition at line 121 of file map.hpp.

◆ selected_province_id

ProvinceId Map::selected_province_id

Definition at line 122 of file map.hpp.

◆ tooltip

UI::Tooltip* Map::tooltip = nullptr

Definition at line 148 of file map.hpp.

◆ tree_spawn_pos

std::vector<glm::vec2> Map::tree_spawn_pos

Definition at line 128 of file map.hpp.

◆ tree_type_models

std::vector<std::shared_ptr<Eng3D::Model> > Map::tree_type_models

Definition at line 127 of file map.hpp.

◆ unit_type_icons

std::vector<std::shared_ptr<Eng3D::Texture> > Map::unit_type_icons

Definition at line 130 of file map.hpp.

◆ unit_type_models

std::vector<std::shared_ptr<Eng3D::Model> > Map::unit_type_models

Definition at line 126 of file map.hpp.

◆ unit_widgets

std::vector<Interface::UnitWidget*> Map::unit_widgets

Definition at line 153 of file map.hpp.

◆ view_mode

MapView Map::view_mode = MapView::PLANE_VIEW

Definition at line 123 of file map.hpp.

◆ wind_osc

float Map::wind_osc = 0.f

Wind oscillator (for flags)

Definition at line 140 of file map.hpp.

◆ world

const World& Map::world

Definition at line 147 of file map.hpp.


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