diff options
author | belugas <belugas@openttd.org> | 2008-02-09 02:49:33 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2008-02-09 02:49:33 +0000 |
commit | cf9447c15b78d84186afb7dc9bde986d415b1014 (patch) | |
tree | 292f9075cca2e5f7c9c3c9e1b59e2dacbc721a5e /src | |
parent | 9343ad44fd27fadf068122d4dbafc0680a36146d (diff) | |
download | openttd-cf9447c15b78d84186afb7dc9bde986d415b1014.tar.xz |
(svn r12090) -Codechange : removed a magic number and code style application on enum ExpensesType
Diffstat (limited to 'src')
-rw-r--r-- | src/economy_type.h | 25 | ||||
-rw-r--r-- | src/player_base.h | 2 | ||||
-rw-r--r-- | src/player_gui.cpp | 2 |
3 files changed, 15 insertions, 14 deletions
diff --git a/src/economy_type.h b/src/economy_type.h index 9b12f4336..02b515ce4 100644 --- a/src/economy_type.h +++ b/src/economy_type.h @@ -112,18 +112,19 @@ assert_compile(NUM_PRICES * sizeof(Money) == sizeof(Prices)); enum ExpensesType { EXPENSES_CONSTRUCTION = 0, - EXPENSES_NEW_VEHICLES = 1, - EXPENSES_TRAIN_RUN = 2, - EXPENSES_ROADVEH_RUN = 3, - EXPENSES_AIRCRAFT_RUN = 4, - EXPENSES_SHIP_RUN = 5, - EXPENSES_PROPERTY = 6, - EXPENSES_TRAIN_INC = 7, - EXPENSES_ROADVEH_INC = 8, - EXPENSES_AIRCRAFT_INC = 9, - EXPENSES_SHIP_INC = 10, - EXPENSES_LOAN_INT = 11, - EXPENSES_OTHER = 12, + EXPENSES_NEW_VEHICLES, + EXPENSES_TRAIN_RUN, + EXPENSES_ROADVEH_RUN, + EXPENSES_AIRCRAFT_RUN, + EXPENSES_SHIP_RUN, + EXPENSES_PROPERTY, + EXPENSES_TRAIN_INC, + EXPENSES_ROADVEH_INC, + EXPENSES_AIRCRAFT_INC, + EXPENSES_SHIP_INC, + EXPENSES_LOAN_INT, + EXPENSES_OTHER, + EXPENSES_END, INVALID_EXPENSES = 0xFF, }; diff --git a/src/player_base.h b/src/player_base.h index 7bc854029..43e6460eb 100644 --- a/src/player_base.h +++ b/src/player_base.h @@ -62,7 +62,7 @@ struct Player { bool is_active; bool is_ai; - Money yearly_expenses[3][13]; + Money yearly_expenses[3][EXPENSES_END]; PlayerEconomyEntry cur_economy; PlayerEconomyEntry old_economy[24]; EngineRenewList engine_renew_list; ///< Defined later diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 01fd4e233..0bf6815e8 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -46,7 +46,7 @@ static void DoSelectPlayerFace(PlayerID player, bool show_big); static void DrawPlayerEconomyStats(const Player *p, byte mode) { int x, y, i, j, year; - const Money (*tbl)[13]; + const Money (*tbl)[EXPENSES_END]; Money sum, cost; StringID str; |