src/callback_table.cpp
author celestar
Mon, 19 Mar 2007 09:33:17 +0000
branchgamebalance
changeset 9894 70d78ac95d6c
parent 6449 e520244dc71e
child 6720 35756db7e577
child 9359 e915dd81a279
permissions -rw-r--r--
(svn r9310) [gamebalance] -Feature: Player performance now influences the wealth level of a town (albeit only on a small scale). This is the first feedback effect that the player has on the local and global economy. Please refrain from using the AI too much for the time being because it'll trash the ratings most likely.
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     2
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
     3
/** @file callback_table.cpp */
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
     4
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     5
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1568
diff changeset
     6
#include "openttd.h"
2762
1582d056d434 (svn r3307) A file shall include its own header
tron
parents: 2557
diff changeset
     7
#include "callback_table.h"
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     8
#include "functions.h"
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     9
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    10
/* If you add a callback for DoCommandP, also add the callback in here
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    11
 *   see below for the full list!
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    12
 * If you don't do it, it won't work across the network!! */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    13
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    14
/* aircraft_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    15
CommandCallback CcBuildAircraft;
2244
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    16
CommandCallback CcCloneAircraft;
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    17
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    18
/* airport_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    19
CommandCallback CcBuildAirport;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    20
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    21
/* bridge_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    22
CommandCallback CcBuildBridge;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    23
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    24
/* dock_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    25
CommandCallback CcBuildDocks;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    26
CommandCallback CcBuildCanal;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    27
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    28
/* depot_gui.cpp */
4689
b4bf1ef178d8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    29
CommandCallback CcCloneVehicle;
b4bf1ef178d8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    30
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    31
/* main_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    32
CommandCallback CcPlaySound10;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    33
CommandCallback CcPlaceSign;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    34
CommandCallback CcTerraform;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    35
CommandCallback CcBuildTown;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    36
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    37
/* rail_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    38
CommandCallback CcPlaySound1E;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    39
CommandCallback CcRailDepot;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    40
CommandCallback CcStation;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    41
CommandCallback CcBuildRailTunnel;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    42
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    43
/* road_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    44
CommandCallback CcPlaySound1D;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    45
CommandCallback CcBuildRoadTunnel;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    46
CommandCallback CcRoadDepot;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    47
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    48
/* roadveh_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    49
CommandCallback CcBuildRoadVeh;
2244
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    50
CommandCallback CcCloneRoadVeh;
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    51
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    52
/* ship_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    53
CommandCallback CcBuildShip;
2244
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    54
CommandCallback CcCloneShip;
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    55
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5835
diff changeset
    56
/* train_gui.cpp */
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    57
CommandCallback CcBuildWagon;
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    58
CommandCallback CcBuildLoco;
2244
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    59
CommandCallback CcCloneTrain;
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    60
3946
c9e039a60682 (svn r5092) -Fix: There was a gross race condition in the AI code which made it pretty random if the AI could give a new vehicle its orders
tron
parents: 2762
diff changeset
    61
CommandCallback CcAI;
c9e039a60682 (svn r5092) -Fix: There was a gross race condition in the AI code which made it pretty random if the AI could give a new vehicle its orders
tron
parents: 2762
diff changeset
    62
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    63
CommandCallback *_callback_table[] = {
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    64
	/* 0x00 */ NULL,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    65
	/* 0x01 */ CcBuildAircraft,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    66
	/* 0x02 */ CcBuildAirport,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    67
	/* 0x03 */ CcBuildBridge,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    68
	/* 0x04 */ CcBuildCanal,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    69
	/* 0x05 */ CcBuildDocks,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    70
	/* 0x06 */ CcBuildLoco,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    71
	/* 0x07 */ CcBuildRoadVeh,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    72
	/* 0x08 */ CcBuildShip,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    73
	/* 0x09 */ CcBuildTown,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    74
	/* 0x0A */ CcBuildRoadTunnel,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    75
	/* 0x0B */ CcBuildRailTunnel,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    76
	/* 0x0C */ CcBuildWagon,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    77
	/* 0x0D */ CcRoadDepot,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    78
	/* 0x0E */ CcRailDepot,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    79
	/* 0x0F */ CcPlaceSign,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    80
	/* 0x10 */ CcPlaySound10,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    81
	/* 0x11 */ CcPlaySound1D,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    82
	/* 0x12 */ CcPlaySound1E,
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    83
	/* 0x13 */ CcStation,
2244
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    84
	/* 0x14 */ CcTerraform,
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    85
	/* 0x15 */ CcCloneAircraft,
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    86
	/* 0x16 */ CcCloneRoadVeh,
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    87
	/* 0x17 */ CcCloneShip,
e6b5ef68406d (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    88
	/* 0x18 */ CcCloneTrain,
4689
b4bf1ef178d8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    89
	/* 0x19 */ CcAI,
b4bf1ef178d8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    90
	/* 0x1A */ CcCloneVehicle
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    91
};
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    92
1568
3a54abe0019a (svn r2072) Use lengthof() instead of a home brewed version
tron
parents: 543
diff changeset
    93
const int _callback_table_count = lengthof(_callback_table);