src/command_type.h
author peter1138
Tue, 22 Jan 2008 07:27:06 +0000
changeset 8374 7a1b6c89cb89
parent 8230 64f28fe2d5c8
child 8486 6118595a0091
permissions -rw-r--r--
(svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either.
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     1
/* $Id$ */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     2
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     3
/** @file command_type.h Types related to commands. */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     4
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     5
#ifndef COMMAND_TYPE_H
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     6
#define COMMAND_TYPE_H
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     7
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     8
#include "economy_type.h"
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
     9
#include "strings_type.h"
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8116
diff changeset
    10
#include "tile_type.h"
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    11
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    12
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    13
 * Common return value for all commands. Wraps the cost and
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    14
 * a possible error message/state together.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    15
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    16
class CommandCost {
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    17
	ExpensesType expense_type; ///< the type of expence as shown on the finances view
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    18
	Money cost;       ///< The cost of this action
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    19
	StringID message; ///< Warning message for when success is unset
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    20
	bool success;     ///< Whether the comment went fine up to this moment
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    21
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    22
public:
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    23
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    24
	 * Creates a command cost return with no cost and no error
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    25
	 */
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    26
	CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {}
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    27
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    28
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    29
	 * Creates a command return value the is failed with the given message
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    30
	 */
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    31
	CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {}
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    32
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    33
	/**
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    34
	 * Creates a command cost with given expense type and start cost of 0
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    35
	 * @param ex_t the expense type
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    36
	 */
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    37
	CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {}
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    38
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    39
	/**
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    40
	 * Creates a command return value with the given start cost and expense type
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    41
	 * @param ex_t the expense type
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    42
	 * @param cst the initial cost of this command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    43
	 */
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    44
	CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    45
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    46
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    47
	 * Adds the cost of the given command return value to this cost.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    48
	 * Also takes a possible error message when it is set.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    49
	 * @param ret the command to add the cost of.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    50
	 * @return this class.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    51
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    52
	CommandCost AddCost(CommandCost ret);
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    53
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    54
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    55
	 * Adds the given cost to the cost of the command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    56
	 * @param cost the cost to add
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    57
	 * @return this class.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    58
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    59
	CommandCost AddCost(Money cost);
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    60
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    61
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    62
	 * Multiplies the cost of the command by the given factor.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    63
	 * @param cost factor to multiply the costs with
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    64
	 * @return this class
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    65
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    66
	CommandCost MultiplyCost(int factor);
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    67
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    68
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    69
	 * The costs as made up to this moment
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    70
	 * @return the costs
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    71
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    72
	Money GetCost() const;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    73
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    74
	/**
8230
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    75
	 * The expense type of the cost
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    76
	 * @return the expense type
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    77
	 */
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    78
	ExpensesType GetExpensesType() const;
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    79
64f28fe2d5c8 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8123
diff changeset
    80
	/**
8116
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    81
	 * Sets the global error message *if* this class has one.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    82
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    83
	void SetGlobalErrorMessage() const;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    84
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    85
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    86
	 * Did this command succeed?
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    87
	 * @return true if and only if it succeeded
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    88
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    89
	bool Succeeded() const;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    90
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    91
	/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    92
	 * Did this command fail?
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    93
	 * @return true if and only if it failed
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    94
	 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    95
	bool Failed() const;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    96
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    97
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    98
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
    99
 * List of commands.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   100
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   101
 * This enum defines all possible commands which can be executed to the game
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   102
 * engine. Observing the game like the query-tool or checking the profit of a
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   103
 * vehicle don't result in a command which should be executed in the engine
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   104
 * nor send to the server in a network game.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   105
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   106
 * @see _command_proc_table
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   107
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   108
enum {
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   109
	CMD_BUILD_RAILROAD_TRACK         =   0, ///< build a rail track
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   110
	CMD_REMOVE_RAILROAD_TRACK        =   1, ///< remove a rail track
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   111
	CMD_BUILD_SINGLE_RAIL            =   2, ///< build a single rail track
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   112
	CMD_REMOVE_SINGLE_RAIL           =   3, ///< remove a single rail track
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   113
	CMD_LANDSCAPE_CLEAR              =   4, ///< demolish a tile
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   114
	CMD_BUILD_BRIDGE                 =   5, ///< build a bridge
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   115
	CMD_BUILD_RAILROAD_STATION       =   6, ///< build a railroad station
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   116
	CMD_BUILD_TRAIN_DEPOT            =   7, ///< build a train depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   117
	CMD_BUILD_SIGNALS                =   8, ///< build a signal
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   118
	CMD_REMOVE_SIGNALS               =   9, ///< remove a signal
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   119
	CMD_TERRAFORM_LAND               =  10, ///< terraform a tile
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   120
	CMD_PURCHASE_LAND_AREA           =  11, ///< purchase a tile
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   121
	CMD_SELL_LAND_AREA               =  12, ///< sell a bought tile before
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   122
	CMD_BUILD_TUNNEL                 =  13, ///< build a tunnel
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   123
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   124
	CMD_REMOVE_FROM_RAILROAD_STATION =  14, ///< remove a tile station
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   125
	CMD_CONVERT_RAIL                 =  15, ///< convert a rail type
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   126
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   127
	CMD_BUILD_TRAIN_WAYPOINT         =  16, ///< build a waypoint
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   128
	CMD_RENAME_WAYPOINT              =  17, ///< rename a waypoint
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   129
	CMD_REMOVE_TRAIN_WAYPOINT        =  18, ///< remove a waypoint
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   130
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   131
	CMD_BUILD_ROAD_STOP              =  21, ///< build a road stop
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   132
	CMD_REMOVE_ROAD_STOP             =  22, ///< remove a road stop
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   133
	CMD_BUILD_LONG_ROAD              =  23, ///< build a complete road (not a "half" one)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   134
	CMD_REMOVE_LONG_ROAD             =  24, ///< remove a complete road (not a "half" one)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   135
	CMD_BUILD_ROAD                   =  25, ///< build a "half" road
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   136
	CMD_REMOVE_ROAD                  =  26, ///< remove a "half" road
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   137
	CMD_BUILD_ROAD_DEPOT             =  27, ///< build a road depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   138
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   139
	CMD_BUILD_AIRPORT                =  29, ///< build an airport
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   140
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   141
	CMD_BUILD_DOCK                   =  30, ///< build a dock
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   142
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   143
	CMD_BUILD_SHIP_DEPOT             =  31, ///< build a ship depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   144
	CMD_BUILD_BUOY                   =  32, ///< build a buoy
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   145
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   146
	CMD_PLANT_TREE                   =  33, ///< plant a tree
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   147
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   148
	CMD_BUILD_RAIL_VEHICLE           =  34, ///< build a rail vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   149
	CMD_MOVE_RAIL_VEHICLE            =  35, ///< move a rail vehicle (in the depot)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   150
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   151
	CMD_START_STOP_TRAIN             =  36, ///< start or stop a train
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   152
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   153
	CMD_SELL_RAIL_WAGON              =  38, ///< sell a rail wagon
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   154
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   155
	CMD_SEND_TRAIN_TO_DEPOT          =  39, ///< send a train to a depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   156
	CMD_FORCE_TRAIN_PROCEED          =  40, ///< proceed a train to pass a red signal
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   157
	CMD_REVERSE_TRAIN_DIRECTION      =  41, ///< turn a train around
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   158
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   159
	CMD_MODIFY_ORDER                 =  42, ///< modify an order (like set full-load)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   160
	CMD_SKIP_TO_ORDER                =  43, ///< skip an order to the next of specific one
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   161
	CMD_DELETE_ORDER                 =  44, ///< delete an order
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   162
	CMD_INSERT_ORDER                 =  45, ///< insert a new order
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   163
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   164
	CMD_CHANGE_SERVICE_INT           =  46, ///< change the server interval of a vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   165
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   166
	CMD_BUILD_INDUSTRY               =  47, ///< build a new industry
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   167
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   168
	CMD_BUILD_COMPANY_HQ             =  48, ///< build the company headquarter
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   169
	CMD_SET_PLAYER_FACE              =  49, ///< set the face of the player/company
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   170
	CMD_SET_PLAYER_COLOR             =  50, ///< set the color of the player/company
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   171
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   172
	CMD_INCREASE_LOAN                =  51, ///< increase the loan from the bank
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   173
	CMD_DECREASE_LOAN                =  52, ///< decrease the loan from the bank
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   174
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   175
	CMD_WANT_ENGINE_PREVIEW          =  53, ///< confirm the preview of an engine
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   176
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   177
	CMD_NAME_VEHICLE                 =  54, ///< rename a whole vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   178
	CMD_RENAME_ENGINE                =  55, ///< rename a engine (in the engine list)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   179
	CMD_CHANGE_COMPANY_NAME          =  56, ///< change the company name
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   180
	CMD_CHANGE_PRESIDENT_NAME        =  57, ///< change the president name
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   181
	CMD_RENAME_STATION               =  58, ///< rename a station
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   182
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   183
	CMD_SELL_AIRCRAFT                =  59, ///< sell an aircraft
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   184
	CMD_START_STOP_AIRCRAFT          =  60, ///< start/stop an aircraft
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   185
	CMD_BUILD_AIRCRAFT               =  61, ///< build an aircraft
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   186
	CMD_SEND_AIRCRAFT_TO_HANGAR      =  62, ///< send an aircraft to a hanger
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   187
	CMD_REFIT_AIRCRAFT               =  64, ///< refit the cargo space of an aircraft
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   188
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   189
	CMD_PLACE_SIGN                   =  65, ///< place a sign
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   190
	CMD_RENAME_SIGN                  =  66, ///< rename a sign
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   191
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   192
	CMD_BUILD_ROAD_VEH               =  67, ///< build a road vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   193
	CMD_START_STOP_ROADVEH           =  68, ///< start/stop a road vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   194
	CMD_SELL_ROAD_VEH                =  69, ///< sell a road vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   195
	CMD_SEND_ROADVEH_TO_DEPOT        =  70, ///< send a road vehicle to the depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   196
	CMD_TURN_ROADVEH                 =  71, ///< turn a road vehicle around
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   197
	CMD_REFIT_ROAD_VEH               =  72, ///< refit the cargo space of a road vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   198
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   199
	CMD_PAUSE                        =  73, ///< pause the game
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   200
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   201
	CMD_BUY_SHARE_IN_COMPANY         =  74, ///< buy a share from a company
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   202
	CMD_SELL_SHARE_IN_COMPANY        =  75, ///< sell a share from a company
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   203
	CMD_BUY_COMPANY                  =  76, ///< buy a company which is bankrupt
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   204
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   205
	CMD_BUILD_TOWN                   =  77, ///< build a town
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   206
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   207
	CMD_RENAME_TOWN                  =  80, ///< rename a town
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   208
	CMD_DO_TOWN_ACTION               =  81, ///< do a action from the town detail window (like advertises or bribe)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   209
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   210
	CMD_SET_ROAD_DRIVE_SIDE          =  82, ///< set the side where the road vehicles drive
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   211
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   212
	CMD_CHANGE_DIFFICULTY_LEVEL      =  85, ///< change the difficult of a game (each setting for it own)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   213
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   214
	CMD_START_STOP_SHIP              =  86, ///< start/stop a ship
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   215
	CMD_SELL_SHIP                    =  87, ///< sell a ship
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   216
	CMD_BUILD_SHIP                   =  88, ///< build a new ship
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   217
	CMD_SEND_SHIP_TO_DEPOT           =  89, ///< send a ship to a depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   218
	CMD_REFIT_SHIP                   =  91, ///< refit the cargo space of a ship
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   219
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   220
	CMD_ORDER_REFIT                  =  98, ///< change the refit informaction of an order (for "goto depot" )
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   221
	CMD_CLONE_ORDER                  =  99, ///< clone (and share) an order
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   222
	CMD_CLEAR_AREA                   = 100, ///< clear an area
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   223
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   224
	CMD_MONEY_CHEAT                  = 102, ///< do the money cheat
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   225
	CMD_BUILD_CANAL                  = 103, ///< build a canal
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   226
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   227
	CMD_PLAYER_CTRL                  = 104, ///< used in multiplayer to create a new player etc.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   228
	CMD_LEVEL_LAND                   = 105, ///< level land
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   229
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   230
	CMD_REFIT_RAIL_VEHICLE           = 106, ///< refit the cargo space of a train
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   231
	CMD_RESTORE_ORDER_INDEX          = 107, ///< restore vehicle order-index and service interval
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   232
	CMD_BUILD_LOCK                   = 108, ///< build a lock
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   233
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   234
	CMD_BUILD_SIGNAL_TRACK           = 110, ///< add signals along a track (by dragging)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   235
	CMD_REMOVE_SIGNAL_TRACK          = 111, ///< remove signals along a track (by dragging)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   236
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   237
	CMD_GIVE_MONEY                   = 113, ///< give money to an other player
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   238
	CMD_CHANGE_PATCH_SETTING         = 114, ///< change a patch setting
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   239
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   240
	CMD_SET_AUTOREPLACE              = 115, ///< set an autoreplace entry
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   241
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   242
	CMD_CLONE_VEHICLE                = 116, ///< clone a vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   243
	CMD_MASS_START_STOP              = 117, ///< start/stop all vehicles (in a depot)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   244
	CMD_DEPOT_SELL_ALL_VEHICLES      = 118, ///< sell all vehicles which are in a given depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   245
	CMD_DEPOT_MASS_AUTOREPLACE       = 119, ///< force the autoreplace to take action in a given depot
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   246
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   247
	CMD_CREATE_GROUP                 = 120, ///< create a new group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   248
	CMD_DELETE_GROUP                 = 121, ///< delete a group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   249
	CMD_RENAME_GROUP                 = 122, ///< rename a group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   250
	CMD_ADD_VEHICLE_GROUP            = 123, ///< add a vehicle to a group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   251
	CMD_ADD_SHARED_VEHICLE_GROUP     = 124, ///< add all other shared vehicles to a group which are missing
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   252
	CMD_REMOVE_ALL_VEHICLES_GROUP    = 125, ///< remove all vehicles from a group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   253
	CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   254
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   255
	CMD_MOVE_ORDER                   = 127, ///< move an order
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   256
	CMD_CHANGE_TIMETABLE             = 128, ///< change the timetable for a vehicle
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   257
	CMD_SET_VEHICLE_ON_TIME          = 129, ///< set the vehicle on time feature (timetable)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   258
	CMD_AUTOFILL_TIMETABLE           = 130, ///< autofill the timetable
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   259
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   260
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   261
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   262
 * List of flags for a command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   263
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   264
 * This enums defines some flags which can be used for the commands.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   265
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   266
enum {
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   267
	DC_EXEC            = 0x01, ///< execute the given command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   268
	DC_AUTO            = 0x02, ///< don't allow building on structures
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   269
	DC_QUERY_COST      = 0x04, ///< query cost only,  don't build.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   270
	DC_NO_WATER        = 0x08, ///< don't allow building on water
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   271
	DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   272
	DC_AI_BUILDING     = 0x20, ///< special building rules for AI
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   273
	DC_NO_TOWN_RATING  = 0x40, ///< town rating does not disallow you from building
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   274
	DC_FORCETEST       = 0x80, ///< force test too.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   275
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   276
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   277
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   278
 * Used to combine a StringID with the command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   279
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   280
 * This macro can be used to add a StringID (the error message to show) on a command-id
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   281
 * (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   282
 * this macro.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   283
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   284
 * @param x The StringID to combine with a command-id
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   285
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   286
#define CMD_MSG(x) ((x) << 16)
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   287
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   288
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   289
 * Defines some flags.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   290
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   291
 * This enumeration defines some flags which are binary-or'ed on a command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   292
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   293
enum {
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   294
	CMD_NO_WATER              = 0x0400, ///< dont build on water
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   295
	CMD_NETWORK_COMMAND       = 0x0800, ///< execute the command without sending it on the network
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   296
	CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   297
	CMD_SHOW_NO_ERROR         = 0x2000, ///< do not show the error message
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   298
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   299
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   300
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   301
 * Command flags for the command table _command_proc_table.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   302
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   303
 * This enumeration defines flags for the _command_proc_table.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   304
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   305
enum {
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   306
	CMD_SERVER  = 0x1, ///< the command can only be initiated by the server
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   307
	CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   308
	CMD_AUTO    = 0x4, ///< set the DC_AUTO flag on this command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   309
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   310
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   311
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   312
 * Defines the callback type for all command handler functions.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   313
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   314
 * This type defines the function header for all functions which handles a CMD_* command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   315
 * A command handler use the parameters to act according to the meaning of the command.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   316
 * The tile parameter defines the tile to perform an action on.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   317
 * The flag parameter is filled with flags from the DC_* enumeration. The parameters
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   318
 * p1 and p2 are filled with parameters for the command like "which road type", "which
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   319
 * order" or "direction". Each function should mentioned in there doxygen comments
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   320
 * the usage of these parameters.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   321
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   322
 * @param tile The tile to apply a command on
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   323
 * @param flags Flags for the command, from the DC_* enumeration
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   324
 * @param p1 Additional data for the command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   325
 * @param p2 Additional data for the command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   326
 * @return The CommandCost of the command, which can be succeeded or failed.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   327
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   328
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   329
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   330
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   331
 * Define a command with the flags which belongs to it.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   332
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   333
 * This struct connect a command handler function with the flags created with
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   334
 * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   335
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   336
struct Command {
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   337
	CommandProc *proc;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   338
	byte flags;
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   339
};
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   340
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   341
/**
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   342
 * Define a callback function for the client, after the command is finished.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   343
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   344
 * Functions of this type are called after the command is finished. The parameters
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   345
 * are from the #CommandProc callback type. The boolean parameter indicates if the
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   346
 * command succeeded or failed.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   347
 *
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   348
 * @param success If the command succeeded or not.
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   349
 * @param tile The tile of the command action
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   350
 * @param p1 Additional data of the command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   351
 * @param p1 Additional data of the command
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   352
 * @see CommandProc
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   353
 */
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   354
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   355
8da76dcb3287 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
diff changeset
   356
#endif /* COMMAND_TYPE_H */