Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
vision.h File Reference
#include "fc_types.h"
#include "improvement.h"

Go to the source code of this file.

Data Structures

struct  vision
 
struct  vision_site
 

Macros

#define vision_layer_iterate(v)
 
#define vision_layer_iterate_end   }}
 
#define V_RADIUS(main_sq, invis_sq, subs_sq)   { (main_sq), (invis_sq), (subs_sq) }
 
#define ASSERT_VISION(v)
 
#define vision_site_owner(v)   ((v)->owner)
 

Typedefs

typedef short int v_radius_t[V_COUNT]
 

Functions

struct visionvision_new (struct player *pplayer, struct tile *ptile)
 
void vision_free (struct vision *vision)
 
bool vision_reveal_tiles (struct vision *vision, bool reveal_tiles)
 
void vision_site_destroy (struct vision_site *psite)
 
struct vision_sitevision_site_new (int identity, struct tile *location, struct player *owner)
 
struct vision_sitevision_site_new_from_city (const struct city *pcity, const struct player *watcher)
 
void vision_site_update_from_city (struct vision_site *psite, const struct city *pcity, const struct player *watcher)
 
struct vision_sitevision_site_copy (const struct vision_site *psite)
 
citizens vision_site_size_get (const struct vision_site *psite)
 
void vision_site_size_set (struct vision_site *psite, citizens size)
 

Macro Definition Documentation

◆ ASSERT_VISION

#define ASSERT_VISION (   v)
Value:
do { \
fc_assert((v)->radius_sq[V_MAIN] >= (v)->radius_sq[V_INVIS]); \
fc_assert((v)->radius_sq[V_MAIN] >= (v)->radius_sq[V_SUBSURFACE]); \
} while (FALSE);
char * incite_cost
Definition comments.c:75
#define FALSE
Definition support.h:47

Definition at line 98 of file vision.h.

◆ V_RADIUS

#define V_RADIUS (   main_sq,
  invis_sq,
  subs_sq 
)    { (main_sq), (invis_sq), (subs_sq) }

Definition at line 96 of file vision.h.

◆ vision_layer_iterate

#define vision_layer_iterate (   v)
Value:
{ \
enum vision_layer v; \
for (v = 0; v < V_COUNT; v++) {

Definition at line 77 of file vision.h.

◆ vision_layer_iterate_end

#define vision_layer_iterate_end   }}

Definition at line 80 of file vision.h.

◆ vision_site_owner

#define vision_site_owner (   v)    ((v)->owner)

Definition at line 129 of file vision.h.

Typedef Documentation

◆ v_radius_t

typedef short int v_radius_t[V_COUNT]

Definition at line 83 of file vision.h.

Function Documentation

◆ vision_free()

void vision_free ( struct vision vision)

Free the vision source.

Definition at line 50 of file vision.c.

Referenced by remove_city(), server_game_free(), server_remove_unit_full(), transfer_city(), unit_change_homecity_handling(), and unit_move().

◆ vision_new()

struct vision * vision_new ( struct player pplayer,
struct tile ptile 
)

◆ vision_reveal_tiles()

bool vision_reveal_tiles ( struct vision vision,
bool  reveal_tiles 
)

Sets the can_reveal_tiles flag. Returns the old flag.

Definition at line 62 of file vision.c.

Referenced by create_city(), sg_load_player_cities(), sg_load_player_cities(), and transfer_city().

◆ vision_site_copy()

struct vision_site * vision_site_copy ( const struct vision_site psite)

Creates a copy of the vision site.

Definition at line 150 of file vision.c.

Referenced by really_give_tile_info_from_player_to_player().

◆ vision_site_destroy()

void vision_site_destroy ( struct vision_site psite)

◆ vision_site_new()

struct vision_site * vision_site_new ( int  identity,
struct tile location,
struct player owner 
)

Returns the basic structure.

Definition at line 86 of file vision.c.

Referenced by sg_load_player_vision(), sg_load_player_vision(), and vision_site_new_from_city().

◆ vision_site_new_from_city()

struct vision_site * vision_site_new_from_city ( const struct city pcity,
const struct player watcher 
)

Returns the basic structure filled with initial elements.

Definition at line 102 of file vision.c.

Referenced by update_dumb_city().

◆ vision_site_size_get()

citizens vision_site_size_get ( const struct vision_site psite)

Get the city size.

Definition at line 170 of file vision.c.

Referenced by package_dumb_city(), sg_save_player_vision(), and update_dumb_city().

◆ vision_site_size_set()

void vision_site_size_set ( struct vision_site psite,
citizens  size 
)

◆ vision_site_update_from_city()

void vision_site_update_from_city ( struct vision_site psite,
const struct city pcity,
const struct player watcher 
)

Returns the basic structure filled with current elements.

Definition at line 123 of file vision.c.

Referenced by update_dumb_city().