Logo Search packages:      
Sourcecode: widelands version File versions  Download package

Map Struct Reference

#include <map.h>

List of all members.


Detailed Description

class Map

This really identifies a map like it is in the game

Odd rows are shifted FIELD_WIDTH/2 to the right. This means that moving up and down depends on the row numbers: even odd top-left -1/-1 0/-1 top-right 0/-1 +1/-1 bottom-left -1/+1 0/+1 bottom-right 0/+1 +1/+1

Warning: width and height must be even

Definition at line 144 of file map.h.


Public Types

enum  { fpBidiCost = 1 }
typedef uint Index

Public Member Functions

FCoords bl_n (const FCoords) const
Coords bl_n (const Coords) const
FCoords br_n (const FCoords) const
Coords br_n (const Coords) const
int calc_bidi_cost (const Coords, const int dir) const
void calc_cost (const Path &, int *forward, int *backward) const
int calc_cost (const Coords, const int dir) const
int calc_cost (const int slope) const
int calc_cost_estimate (const Coords, const Coords) const
int calc_cost_lowerbound (const Coords, const Coords) const
uint calc_distance (const Coords, const Coords) const
Military_Influence calc_influence (const Coords a, const Area<>) const
 Returns the military influence on a location from an area.
bool can_reach_by_water (const Coords) const
uint change_height (Area< FCoords >, const Sint16 difference)
 Changes the height of the nodes in an Area by a difference.
int change_terrain (const TCoords< FCoords >, const Terrain_Descr::Index terrain)
void cleanup ()
void create_empty_map (const uint w=64, const uint h=64, const std::string worldname=std::string("greenland"))
Extent extent () const throw ()
uint find_bobs (const Area< FCoords >, std::vector< Bob * > *list, const FindBob &functor=FindBobAlwaysTrue())
uint find_fields (const Area< FCoords >, std::vector< Coords > *list, const FindNode &functor)
uint find_immovables (const Area< FCoords >, std::vector< ImmovableFound > *list, const FindImmovable &=FindImmovableAlwaysTrue())
uint find_reachable_bobs (const Area< FCoords >, std::vector< Bob * > *list, const CheckStep &, const FindBob &functor=FindBobAlwaysTrue())
uint find_reachable_fields (const Area< FCoords >, std::vector< Coords > *list, const CheckStep &, const FindNode &)
uint find_reachable_immovables (const Area< FCoords >, std::vector< ImmovableFound > *list, const CheckStep &, const FindImmovable &=FindImmovableAlwaysTrue())
int findpath (Coords instart, Coords inend, const int persist, Path &, const CheckStep &, const uint flags=0)
const char * get_author () const
const std::string & get_background () const
void get_bln (const FCoords, FCoords *const) const
void get_bln (const Coords, Coords *const) const
void get_brn (const FCoords, FCoords *const) const
void get_brn (const Coords, Coords *const) const
void get_coords (Field &f, Coords &c) const
Map_Loader * get_correct_loader (const char *)
const char * get_description () const
FCoords get_fcoords (Field &) const
FCoords get_fcoords (const Coords) const
const Fieldget_field (const uint x, const uint y) const
Fieldget_field (const Coords) const
Fieldget_field (const Index) const
const char * get_filename () const
Y_Coordinate get_height () const throw ()
BaseImmovable * get_immovable (const Coords) const
void get_ln (const FCoords, FCoords *const) const
void get_ln (const Coords, Coords *const) const
MapEventChainManager & get_mecm ()
const MapEventChainManager & get_mecm () const
MapEventManager & get_mem ()
const MapEventManager & get_mem () const
MapObjectiveManager & get_mom ()
const MapObjectiveManager & get_mom () const
MapTriggerManager & get_mtm ()
const MapTriggerManager & get_mtm () const
MapVariableManager & get_mvm ()
const MapVariableManager & get_mvm () const
const char * get_name () const
FCoords get_neighbour (const FCoords f, const Direction dir) const throw ()
void get_neighbour (const FCoords, const Direction dir, FCoords *const) const
void get_neighbour (const Coords, const Direction dir, Coords *const) const
Uint8 get_nrplayers () const throw ()
Overlay_Manager & get_overlay_manager () const
Overlay_Manager * get_overlay_manager ()
void get_rn (const FCoords, FCoords *const) const
void get_rn (const Coords, Coords *const) const
std::string get_scenario_player_name (uint i)
std::string get_scenario_player_tribe (uint i)
Coords get_starting_pos (const uint plnum) const
void get_tln (const FCoords, FCoords *const) const
void get_tln (const Coords, Coords *const) const
void get_trn (const FCoords, FCoords *const) const
void get_trn (const Coords, Coords *const) const
X_Coordinate get_width () const throw ()
Worldget_world () const
const char * get_world_name () const
int is_neighbour (const Coords, const Coords) const
FCoords l_n (const FCoords) const
Coords l_n (const Coords) const
void load_graphics ()
 Map ()
Index max_index () const
void normalize_coords (Coords *) const
Fieldoperator[] (const Coords) const
Fieldoperator[] (const Index) const
Overlay_Manager & overlay_manager ()
const Overlay_Manager & overlay_manager () const
FCoords r_n (const FCoords) const
Coords r_n (const Coords) const
void recalc_default_resources ()
void recalc_for_field_area (const Area< FCoords >)
void recalc_whole_map ()
void set_author (const char *string)
void set_background (const char *string)
void set_description (const char *string)
void set_filename (const char *string)
uint set_height (Area< FCoords >, interval< Field::Height > height_interval)
uint set_height (const FCoords, const Uint8 new_value)
void set_name (const char *string)
void set_nrplayers (const Uint8 nrplayers)
void set_scenario_player_name (uint i, std::string)
void set_scenario_player_tribe (uint i, std::string)
void set_starting_pos (const uint plnum, const Coords)
void set_world_name (const char *string)
FCoords tl_n (const FCoords) const
Coords tl_n (const Coords) const
FCoords tr_n (const FCoords) const
Coords tr_n (const Coords) const
Worldworld () const throw ()

Static Public Member Functions

static Index get_index (const Coords c, const X_Coordinate width)

Private Member Functions

void check_neighbour_heights (FCoords, uint &radius)
template<typename functorT>
void find (const Area< FCoords >, functorT &) const
template<typename functorT>
void find_reachable (const Area< FCoords >, const CheckStep &, functorT &)
void increase_pathcycle ()
void load_world ()
 Map (const Map &)
Mapoperator= (const Map &)
void recalc_border (const FCoords)
void recalc_brightness (FCoords)
void recalc_fieldcaps_pass1 (FCoords)
void recalc_fieldcaps_pass2 (FCoords)
void set_size (const uint w, const uint h)

Private Attributes

char m_author [61]
std::string m_background
char m_description [1024]
std::vector< Extradata_Info > m_extradatainfos
Fieldm_fields
char m_filename [256]
Y_Coordinate m_height
MapEventChainManager * m_mecm
MapEventManager * m_mem
MapObjectiveManager * m_mom
MapTriggerManager * m_mtm
MapVariableManager * m_mvm
char m_name [61]
Uint8 m_nrplayers
Overlay_Manager * m_overlay_manager
Uint16 m_pathcycle
Pathfieldm_pathfields
std::vector< std::string > m_scenario_names
std::vector< std::string > m_scenario_tribes
Coordsm_starting_pos
X_Coordinate m_width
Worldm_world
char m_worldname [1024]

Friends

class Editor
class Editor_Game_Base
class Main_Menu_New_Map
class Map_Loader
class S2_Map_Loader
class Widelands_Map_Elemental_Data_Packet
class Widelands_Map_Extradata_Data_Packet
class Widelands_Map_Loader

Classes

struct  Extradata_Info
struct  Pathfield

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

Generated by  Doxygen 1.6.0   Back to index