src/town_type.h
author rubidium
Wed, 09 Jul 2008 19:30:44 +0000
branch0.6
changeset 11131 d8136dad6b1c
parent 8709 4187ad809fe7
child 9292 4f5612017238
permissions -rw-r--r--
(svn r13689) [0.6] -Backport from trunk:
- Fix: Server crashing when banning the rconning client (r13661)
- Fix: Incorrect usage of strtoul (r13508)
- Fix: Crash when one tries to raise the nothern corner of MP_VOID tiles (i.e. the southern corner of the tiles on the southern map edge) in the scenario editor [FS#2106] (r13624)
- Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1977
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1977
diff changeset
     2
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
     3
/** @file town_type.h Types related to towns. */
6658
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
     4
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
     5
#ifndef TOWN_TYPE_H
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
     6
#define TOWN_TYPE_H
6658
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
     7
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
     8
#include "core/enum_type.hpp"
6658
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
     9
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    10
typedef uint16 TownID;
6658
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
    11
typedef uint16 HouseID;
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
    12
typedef uint16 HouseClassID;
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
    13
7882
64cdb1d52f16 (svn r10755) -Codechange: make the town struct use the pool item class as super class.
rubidium
parents: 7452
diff changeset
    14
struct Town;
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    15
struct HouseSpec;
6658
59048224be55 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents: 6573
diff changeset
    16
6982
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    17
enum TownSizeMode {
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    18
	TSM_RANDOM,
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    19
	TSM_FIXED,
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    20
	TSM_CITY
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    21
};
c414fad6c440 (svn r9667) -Feature: Add the concept of cities. A (configurable) proportion of towns can
maedhros
parents: 6980
diff changeset
    22
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    23
enum {
6918
5589c415e28f (svn r9558) -Documentation: doxygen and comment changes: 'T' now. Almost done
belugas
parents: 6667
diff changeset
    24
	/* These refer to the maximums, so Appalling is -1000 to -400
5589c415e28f (svn r9558) -Documentation: doxygen and comment changes: 'T' now. Almost done
belugas
parents: 6667
diff changeset
    25
	 * MAXIMUM RATINGS BOUNDARIES */
3432
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    26
	RATING_MINIMUM     = -1000,
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    27
	RATING_APPALLING   =  -400,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    28
	RATING_VERYPOOR    =  -200,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    29
	RATING_POOR        =     0,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    30
	RATING_MEDIOCRE    =   200,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    31
	RATING_GOOD        =   400,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    32
	RATING_VERYGOOD    =   600,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    33
	RATING_EXCELLENT   =   800,
6918
5589c415e28f (svn r9558) -Documentation: doxygen and comment changes: 'T' now. Almost done
belugas
parents: 6667
diff changeset
    34
	RATING_OUTSTANDING =  1000,         ///< OUTSTANDING
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    35
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    36
	RATING_MAXIMUM = RATING_OUTSTANDING,
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    37
6918
5589c415e28f (svn r9558) -Documentation: doxygen and comment changes: 'T' now. Almost done
belugas
parents: 6667
diff changeset
    38
	/* RATINGS AFFECTING NUMBERS */
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    39
	RATING_TREE_DOWN_STEP = -35,
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    40
	RATING_TREE_MINIMUM   = RATING_MINIMUM,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    41
	RATING_TREE_UP_STEP   = 7,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    42
	RATING_TREE_MAXIMUM   = 220,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    43
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    44
	RATING_TUNNEL_BRIDGE_DOWN_STEP = -250,
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    45
	RATING_TUNNEL_BRIDGE_MINIMUM   = 0,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    46
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    47
	RATING_INDUSTRY_DOWN_STEP = -1500,
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    48
	RATING_INDUSTRY_MINIMUM   = RATING_MINIMUM,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    49
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    50
	RATING_ROAD_DOWN_STEP = -50,
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    51
	RATING_ROAD_MINIMUM   = -100,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4277
diff changeset
    52
	RATING_HOUSE_MINIMUM  = RATING_MINIMUM,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    53
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    54
	RATING_BRIBE_UP_STEP = 200,
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    55
	RATING_BRIBE_MAXIMUM = 800,
3432
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    56
	RATING_BRIBE_DOWN_TO = -50        // XXX SHOULD BE SOMETHING LOWER?
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    57
};
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    58
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    59
/**
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    60
 * Town Layouts
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    61
 */
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    62
enum TownLayout {
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    63
	TL_NO_ROADS     = 0, ///< Build no more roads, but still build houses
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    64
	TL_ORIGINAL,         ///< Original algorithm (min. 1 distance between roads)
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    65
	TL_BETTER_ROADS,     ///< Extended original algorithm (min. 2 distance between roads)
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    66
	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    67
	TL_3X3_GRID,         ///< Geometric 3x3 grid algorithm
3432
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    68
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    69
	NUM_TLS,             ///< Number of town layouts
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    70
};
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    71
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    72
/* It needs to be 8bits, because we save and load it as such */
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    73
/** Define basic enum properties */
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    74
template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    75
typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
4354
684ab9249dae (svn r6055) -Codechange: added GetXXXArraySize, which returns HighestID + 1 (or, will do that).
truelight
parents: 4352
diff changeset
    76
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    77
#endif /* TOWN_TYPE_H */