Freeciv-3.2
Loading...
Searching...
No Matches
Functions
reqtree.h File Reference
#include "canvas_g.h"

Go to the source code of this file.

Functions

struct reqtreecreate_reqtree (struct player *pplayer, bool show_all)
 
void destroy_reqtree (struct reqtree *tree)
 
void get_reqtree_dimensions (struct reqtree *tree, int *width, int *height)
 
void draw_reqtree (struct reqtree *tree, struct canvas *pcanvas, int canvas_x, int canvas_y, int tt_x, int tt_y, int w, int h)
 
Tech_type_id get_tech_on_reqtree (struct reqtree *tree, int x, int y)
 
bool find_tech_on_reqtree (struct reqtree *tree, Tech_type_id tech, int *x, int *y, int *w, int *h)
 

Function Documentation

◆ create_reqtree()

struct reqtree * create_reqtree ( struct player pplayer,
bool  show_all 
)

Generate optimized tech_tree from current ruleset. You should free it by destroy_reqtree().

If pplayer is not NULL, techs unreachable to that player are not shown.

Definition at line 839 of file reqtree.c.

Referenced by research_diagram::reset(), and science_diagram_data().

◆ destroy_reqtree()

void destroy_reqtree ( struct reqtree tree)

Free all memory used by tech_tree struct

Definition at line 473 of file reqtree.c.

Referenced by create_reqtree(), research_diagram::reset(), science_diagram_data(), and research_diagram::~research_diagram().

◆ draw_reqtree()

void draw_reqtree ( struct reqtree tree,
struct canvas pcanvas,
int  canvas_x,
int  canvas_y,
int  tt_x,
int  tt_y,
int  w,
int  h 
)

Draw the reqtree diagram!

This draws the given portion of the reqtree diagram (given by (tt_x,tt_y) and (w,h) onto the canvas at position (canvas_x, canvas_y).

Definition at line 1036 of file reqtree.c.

Referenced by science_diagram_update(), science_diagram_update(), and research_diagram::update_reqtree().

◆ find_tech_on_reqtree()

bool find_tech_on_reqtree ( struct reqtree tree,
Tech_type_id  tech,
int x,
int y,
int w,
int h 
)

Return the position of the given tech on the reqtree. Return TRUE iff it was found.

Definition at line 1199 of file reqtree.c.

Referenced by science_diagram_center().

◆ get_reqtree_dimensions()

void get_reqtree_dimensions ( struct reqtree reqtree,
int width,
int height 
)

Give the dimensions of the reqtree.

Definition at line 870 of file reqtree.c.

Referenced by research_diagram::reset(), science_diagram_center(), science_diagram_data(), science_diagram_update(), and science_diagram_update().

◆ get_tech_on_reqtree()

Tech_type_id get_tech_on_reqtree ( struct reqtree tree,
int  x,
int  y 
)

Return the tech ID at the given position of the reqtree (or A_NONE).

Definition at line 1176 of file reqtree.c.

Referenced by research_diagram::mousePressEvent(), science_diagram_button_release_callback(), science_diagram_left_button_up(), and science_diagram_right_button_up().