# map_type.h File Reference

Types related to maps. More...

Go to the source code of this file.

## Data Structures
struct | Tile
| Data that is stored per tile. More...
struct | TileExtended
| Data that is stored per tile. More...
struct | TileIndexDiffC
| A pair-construct of a TileIndexDiff. More...
## Defines
#define | STRAIGHT_TRACK_LENGTH 7071/10000
| Approximation of the length of a straight track, relative to a diagonal track (ie the size of a tile side).
## Typedefs
typedef int32 | TileIndexDiff
| An offset value between to tiles.
## Enumerations
enum | { MIN_MAP_SIZE_BITS = 6, MAX_MAP_SIZE_BITS = 11, MIN_MAP_SIZE = 1 << MIN_MAP_SIZE_BITS, MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS }
| Minimal and maximal map width and height. More...

## Detailed Description

Types related to maps.

Definition in file map_type.h.

## Define Documentation

#define STRAIGHT_TRACK_LENGTH 7071/10000

Approximation of the length of a straight track, relative to a diagonal track (ie the size of a tile side).

defined instead of const so it can stay integer. (no runtime float operations) Is this needed? Watch out! There are _no_ brackets around here, to prevent intermediate rounding! Be careful when using this! This value should be sqrt(2)/2 ~ 0.7071

Definition at line 78 of file map_type.h.

Referenced by NPFDistanceTrack().

## Typedef Documentation

typedef int32 TileIndexDiff

An offset value between to tiles.

This value is used fro the difference between to tiles. It can be added to a tileindex to get the resulting tileindex of the start tile applied with this saved difference.

See also:
  TileDiffXY(int, int)

Definition at line 47 of file map_type.h.

## Enumeration Type Documentation

anonymous enum

Minimal and maximal map width and height.

Enumerator:

  MIN_MAP_SIZE_BITS | Minimal size of map is equal to 2 ^ MIN_MAP_SIZE_BITS.
  MAX_MAP_SIZE_BITS | Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS.
  MIN_MAP_SIZE | Minimal map size = 64.
  MAX_MAP_SIZE | Maximal map size = 2048.

Definition at line 61 of file map_type.h.