Freeciv21
Develop your civilization from humble roots to a global empire
climap.cpp File Reference
#include "map.h"
#include "shared.h"
#include "client_main.h"
#include "climap.h"
#include "tileset/tilespec.h"
+ Include dependency graph for climap.cpp:

Go to the source code of this file.

Functions

enum known_type client_tile_get_known (const struct tile *ptile)
 A tile's "known" field is used by the server to store whether each player knows the tile. More...
 
enum direction8 gui_to_map_dir (enum direction8 gui_dir)
 Convert the given GUI direction into a map direction. More...
 
struct tileclient_city_tile (const struct city *pcity)
 Client variant of city_tile(). More...
 
bool client_city_can_work_tile (const struct city *pcity, const struct tile *ptile)
 Returns TRUE when a tile is available to be worked, or the city itself is currently working the tile (and can continue). More...
 

Function Documentation

◆ client_city_can_work_tile()

bool client_city_can_work_tile ( const struct city pcity,
const struct tile ptile 
)

Returns TRUE when a tile is available to be worked, or the city itself is currently working the tile (and can continue).

See also city_can_work_tile() (common/city.[ch]).

Definition at line 114 of file climap.cpp.

Referenced by freeciv::layer_grid::fill_sprite_array(), and find_city_or_settler_near_tile().

◆ client_city_tile()

struct tile* client_city_tile ( const struct city pcity)

Client variant of city_tile().

This include the case of this could a ghost city (see client/packhand.c). In a such case, the returned tile is an approximative position of the city on the map.

Definition at line 64 of file climap.cpp.

Referenced by chat_widget::anchor_clicked().

◆ client_tile_get_known()

enum known_type client_tile_get_known ( const struct tile ptile)

A tile's "known" field is used by the server to store whether each player knows the tile.

Client-side, it's used as an enum known_type to track whether the tile is known/fogged/unknown.

Judicious use of this function also makes things very convenient for civworld, since it uses both client and server-style storage; since it uses the stock tilespec.c file, this function serves as a wrapper.

Definition at line 1 of file climap.cpp.

Referenced by build_tile_data(), center_on_something(), freeciv::layer_terrain::fill_blending_sprite_array(), freeciv::layer_darkness::fill_sprite_array(), freeciv::layer_fog::fill_sprite_array(), freeciv::layer_grid::fill_sprite_array(), freeciv::layer_overlays::fill_sprite_array(), handle_tile_info(), popup_info_text(), popup_tile_info(), put_one_element(), put_one_tile(), put_overview_tile_area(), freeciv::tileset_debugger::set_tile(), and unit_drawn_with_city_outline().

◆ gui_to_map_dir()

enum direction8 gui_to_map_dir ( enum direction8  gui_dir)

Convert the given GUI direction into a map direction.

GUI directions correspond to the current viewing interface, so that DIR8_NORTH is up on the mapview. map directions correspond to the underlying map tiles, so that DIR8_NORTH means moving with a vector of (0,-1). Neither necessarily corresponds to "north" on the underlying world (once iso-maps are possible).

Definition at line 1 of file climap.cpp.

Referenced by key_unit_move().