src/town_type.h
author rubidium
Fri, 18 Jul 2008 12:20:31 +0000
changeset 11171 04fc8e49df1b
parent 10862 2aed339e2a78
permissions -rw-r--r--
(svn r13729) -Fix: assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded.
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
9310
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    38
	RATING_INITIAL = 500, ///< initial rating
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    39
6918
5589c415e28f (svn r9558) -Documentation: doxygen and comment changes: 'T' now. Almost done
belugas
parents: 6667
diff changeset
    40
	/* RATINGS AFFECTING NUMBERS */
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    41
	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
    42
	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
    43
	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
    44
	RATING_TREE_MAXIMUM   = 220,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    45
9310
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    46
	RATING_GROWTH_UP_STEP    =   5, ///< when a town grows, all players have rating increased a bit ...
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    47
	RATING_GROWTH_MAXIMUM    = RATING_MEDIOCRE, ///< ... up to RATING_MEDIOCRE
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    48
	RATING_STATION_UP_STEP   =  12, ///< when a town grows, player gains reputation for all well serviced stations ...
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    49
	RATING_STATION_DOWN_STEP = -15, ///< ... but loses for bad serviced stations
08b3b745d299 (svn r12560) -Cleanup: town_cmd.cpp and header files - variable scope and a bit of coding style
smatz
parents: 9292
diff changeset
    50
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    51
	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
    52
	RATING_TUNNEL_BRIDGE_MINIMUM   = 0,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    53
10690
2a363031721a (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9310
diff changeset
    54
	RATING_ROAD_DOWN_STEP_INNER = -50, ///< removing a roadpiece in the middle
2a363031721a (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9310
diff changeset
    55
	RATING_ROAD_DOWN_STEP_EDGE  = -18, ///< removing a roadpiece at the edge
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
    56
	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
    57
	RATING_HOUSE_MINIMUM  = RATING_MINIMUM,
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    58
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    59
	RATING_BRIBE_UP_STEP = 200,
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    60
	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
    61
	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
    62
};
507fa7fd189d (svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents: 3349
diff changeset
    63
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    64
/**
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    65
 * Town Layouts
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    66
 */
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    67
enum TownLayout {
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    68
	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
    69
	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
    70
	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
    71
	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    72
	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
    73
9292
4f5612017238 (svn r12534) -Feature: Add a new type of town road layouts - random for each town
skidd13
parents: 8709
diff changeset
    74
	TL_RANDOM,           ///< Random town layout
4f5612017238 (svn r12534) -Feature: Add a new type of town road layouts - random for each town
skidd13
parents: 8709
diff changeset
    75
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    76
	NUM_TLS,             ///< Number of town layouts
1005
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    77
};
8c6a9bf44bf1 (svn r1504) enummed town ratings (Jango)
celestar
parents: 919
diff changeset
    78
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    79
/* 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
    80
/** Define basic enum properties */
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    81
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
    82
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
    83
8709
4187ad809fe7 (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium
parents: 8683
diff changeset
    84
#endif /* TOWN_TYPE_H */