src/command_type.h
author convert-repo
Mon, 07 Apr 2008 16:21:55 +0000
changeset 10076 dfd70e42c4ae
parent 9337 465e7f3da509
child 10080 e0a9b92ed875
permissions -rw-r--r--
update tags
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1820
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 1820
diff changeset
     2
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     3
/** @file command_type.h Types related to commands. */
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
     4
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     5
#ifndef COMMAND_TYPE_H
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     6
#define COMMAND_TYPE_H
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     7
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     8
#include "economy_type.h"
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
     9
#include "strings_type.h"
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8612
diff changeset
    10
#include "tile_type.h"
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    11
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    12
/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    13
 * Common return value for all commands. Wraps the cost and
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    14
 * a possible error message/state together.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    15
 */
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    16
class CommandCost {
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    17
	ExpensesType expense_type; ///< the type of expence as shown on the finances view
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    18
	Money cost;       ///< The cost of this action
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    19
	StringID message; ///< Warning message for when success is unset
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    20
	bool success;     ///< Whether the comment went fine up to this moment
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    21
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    22
public:
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    23
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    24
	 * Creates a command cost return with no cost and no error
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    25
	 */
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    26
	CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    27
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    28
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    29
	 * Creates a command return value the is failed with the given message
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    30
	 */
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    31
	CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    32
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    33
	/**
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    34
	 * Creates a command cost with given expense type and start cost of 0
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    35
	 * @param ex_t the expense type
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    36
	 */
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    37
	CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {}
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    38
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    39
	/**
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    40
	 * Creates a command return value with the given start cost and expense type
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    41
	 * @param ex_t the expense type
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    42
	 * @param cst the initial cost of this command
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    43
	 */
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    44
	CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    45
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    46
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    47
	 * Adds the cost of the given command return value to this cost.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    48
	 * Also takes a possible error message when it is set.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    49
	 * @param ret the command to add the cost of.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    50
	 * @return this class.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    51
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    52
	CommandCost AddCost(CommandCost ret)
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    53
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    54
		this->AddCost(ret.cost);
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    55
		if (this->success && !ret.success) {
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    56
			this->message = ret.message;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    57
			this->success = false;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    58
		}
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    59
		return *this;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    60
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    61
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    62
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    63
	 * Adds the given cost to the cost of the command.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    64
	 * @param cost the cost to add
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    65
	 * @return this class.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    66
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    67
	CommandCost AddCost(Money cost)
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    68
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    69
		this->cost += cost;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    70
		return *this;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    71
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    72
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    73
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    74
	 * Multiplies the cost of the command by the given factor.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    75
	 * @param cost factor to multiply the costs with
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    76
	 * @return this class
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    77
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    78
	CommandCost MultiplyCost(int factor)
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    79
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    80
		this->cost *= factor;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    81
		return *this;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    82
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    83
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    84
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    85
	 * The costs as made up to this moment
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    86
	 * @return the costs
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    87
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    88
	Money GetCost() const
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    89
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    90
		return this->cost;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    91
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    92
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
    93
	/**
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    94
	 * The expense type of the cost
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    95
	 * @return the expense type
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
    96
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    97
	ExpensesType GetExpensesType() const
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    98
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
    99
		return this->expense_type;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   100
	}
8726
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
   101
5ae45b46506b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
rubidium
parents: 8619
diff changeset
   102
	/**
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   103
	 * Sets the global error message *if* this class has one.
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   104
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   105
	void SetGlobalErrorMessage() const
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   106
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   107
		extern StringID _error_message;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   108
		if (this->message != INVALID_STRING_ID) _error_message = this->message;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   109
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   110
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   111
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   112
	 * Did this command succeed?
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   113
	 * @return true if and only if it succeeded
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   114
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   115
	bool Succeeded() const
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   116
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   117
		return this->success;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   118
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   119
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   120
	/**
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   121
	 * Did this command fail?
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   122
	 * @return true if and only if it failed
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   123
	 */
9337
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   124
	bool Failed() const
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   125
	{
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   126
		return !this->success;
465e7f3da509 (svn r12591) -Codechange: move CommandCost accessors to header file, 8kB of binary size saved
smatz
parents: 9015
diff changeset
   127
	}
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   128
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   130
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   131
 * List of commands.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   132
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   133
 * This enum defines all possible commands which can be executed to the game
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   134
 * engine. Observing the game like the query-tool or checking the profit of a
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   135
 * vehicle don't result in a command which should be executed in the engine
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   136
 * nor send to the server in a network game.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   137
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   138
 * @see _command_proc_table
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   139
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
enum {
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   141
	CMD_BUILD_RAILROAD_TRACK,         ///< build a rail track
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   142
	CMD_REMOVE_RAILROAD_TRACK,        ///< remove a rail track
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   143
	CMD_BUILD_SINGLE_RAIL,            ///< build a single rail track
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   144
	CMD_REMOVE_SINGLE_RAIL,           ///< remove a single rail track
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   145
	CMD_LANDSCAPE_CLEAR,              ///< demolish a tile
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   146
	CMD_BUILD_BRIDGE,                 ///< build a bridge
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   147
	CMD_BUILD_RAILROAD_STATION,       ///< build a railroad station
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   148
	CMD_BUILD_TRAIN_DEPOT,            ///< build a train depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   149
	CMD_BUILD_SIGNALS,                ///< build a signal
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   150
	CMD_REMOVE_SIGNALS,               ///< remove a signal
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   151
	CMD_TERRAFORM_LAND,               ///< terraform a tile
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   152
	CMD_PURCHASE_LAND_AREA,           ///< purchase a tile
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   153
	CMD_SELL_LAND_AREA,               ///< sell a bought tile before
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   154
	CMD_BUILD_TUNNEL,                 ///< build a tunnel
8056
1020455bfd81 (svn r11085) -Fix-ish (r11084): some tabs that did not show up in the diff, which caused a mess of tab and non-tab usage.
rubidium
parents: 8055
diff changeset
   155
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   156
	CMD_REMOVE_FROM_RAILROAD_STATION, ///< remove a tile station
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   157
	CMD_CONVERT_RAIL,                 ///< convert a rail type
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   158
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   159
	CMD_BUILD_TRAIN_WAYPOINT,         ///< build a waypoint
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   160
	CMD_RENAME_WAYPOINT,              ///< rename a waypoint
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   161
	CMD_REMOVE_TRAIN_WAYPOINT,        ///< remove a waypoint
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   162
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   163
	CMD_BUILD_ROAD_STOP,              ///< build a road stop
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   164
	CMD_REMOVE_ROAD_STOP,             ///< remove a road stop
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   165
	CMD_BUILD_LONG_ROAD,              ///< build a complete road (not a "half" one)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   166
	CMD_REMOVE_LONG_ROAD,             ///< remove a complete road (not a "half" one)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   167
	CMD_BUILD_ROAD,                   ///< build a "half" road
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   168
	CMD_REMOVE_ROAD,                  ///< remove a "half" road
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   169
	CMD_BUILD_ROAD_DEPOT,             ///< build a road depot
8056
1020455bfd81 (svn r11085) -Fix-ish (r11084): some tabs that did not show up in the diff, which caused a mess of tab and non-tab usage.
rubidium
parents: 8055
diff changeset
   170
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   171
	CMD_BUILD_AIRPORT,                ///< build an airport
8056
1020455bfd81 (svn r11085) -Fix-ish (r11084): some tabs that did not show up in the diff, which caused a mess of tab and non-tab usage.
rubidium
parents: 8055
diff changeset
   172
8996
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   173
	CMD_BUILD_DOCK,                   ///< build a dock
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   174
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   175
	CMD_BUILD_SHIP_DEPOT,             ///< build a ship depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   176
	CMD_BUILD_BUOY,                   ///< build a buoy
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   177
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   178
	CMD_PLANT_TREE,                   ///< plant a tree
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   179
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   180
	CMD_BUILD_RAIL_VEHICLE,           ///< build a rail vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   181
	CMD_MOVE_RAIL_VEHICLE,            ///< move a rail vehicle (in the depot)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   182
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   183
	CMD_START_STOP_TRAIN,             ///< start or stop a train
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   184
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   185
	CMD_SELL_RAIL_WAGON,              ///< sell a rail wagon
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   186
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   187
	CMD_SEND_TRAIN_TO_DEPOT,          ///< send a train to a depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   188
	CMD_FORCE_TRAIN_PROCEED,          ///< proceed a train to pass a red signal
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   189
	CMD_REVERSE_TRAIN_DIRECTION,      ///< turn a train around
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   190
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   191
	CMD_MODIFY_ORDER,                 ///< modify an order (like set full-load)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   192
	CMD_SKIP_TO_ORDER,                ///< skip an order to the next of specific one
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   193
	CMD_DELETE_ORDER,                 ///< delete an order
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   194
	CMD_INSERT_ORDER,                 ///< insert a new order
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   195
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   196
	CMD_CHANGE_SERVICE_INT,           ///< change the server interval of a vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   197
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   198
	CMD_BUILD_INDUSTRY,               ///< build a new industry
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   199
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   200
	CMD_BUILD_COMPANY_HQ,             ///< build the company headquarter
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   201
	CMD_SET_PLAYER_FACE,              ///< set the face of the player/company
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   202
	CMD_SET_PLAYER_COLOR,             ///< set the color of the player/company
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   203
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   204
	CMD_INCREASE_LOAN,                ///< increase the loan from the bank
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   205
	CMD_DECREASE_LOAN,                ///< decrease the loan from the bank
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   206
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   207
	CMD_WANT_ENGINE_PREVIEW,          ///< confirm the preview of an engine
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   208
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   209
	CMD_NAME_VEHICLE,                 ///< rename a whole vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   210
	CMD_RENAME_ENGINE,                ///< rename a engine (in the engine list)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   211
	CMD_CHANGE_COMPANY_NAME,          ///< change the company name
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   212
	CMD_CHANGE_PRESIDENT_NAME,        ///< change the president name
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   213
	CMD_RENAME_STATION,               ///< rename a station
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   214
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   215
	CMD_SELL_AIRCRAFT,                ///< sell an aircraft
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   216
	CMD_START_STOP_AIRCRAFT,          ///< start/stop an aircraft
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   217
	CMD_BUILD_AIRCRAFT,               ///< build an aircraft
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   218
	CMD_SEND_AIRCRAFT_TO_HANGAR,      ///< send an aircraft to a hanger
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   219
	CMD_REFIT_AIRCRAFT,               ///< refit the cargo space of an aircraft
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   220
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   221
	CMD_PLACE_SIGN,                   ///< place a sign
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   222
	CMD_RENAME_SIGN,                  ///< rename a sign
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   223
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   224
	CMD_BUILD_ROAD_VEH,               ///< build a road vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   225
	CMD_START_STOP_ROADVEH,           ///< start/stop a road vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   226
	CMD_SELL_ROAD_VEH,                ///< sell a road vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   227
	CMD_SEND_ROADVEH_TO_DEPOT,        ///< send a road vehicle to the depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   228
	CMD_TURN_ROADVEH,                 ///< turn a road vehicle around
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   229
	CMD_REFIT_ROAD_VEH,               ///< refit the cargo space of a road vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   230
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   231
	CMD_PAUSE,                        ///< pause the game
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   232
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   233
	CMD_BUY_SHARE_IN_COMPANY,         ///< buy a share from a company
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   234
	CMD_SELL_SHARE_IN_COMPANY,        ///< sell a share from a company
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   235
	CMD_BUY_COMPANY,                  ///< buy a company which is bankrupt
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   236
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   237
	CMD_BUILD_TOWN,                   ///< build a town
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   238
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   239
	CMD_RENAME_TOWN,                  ///< rename a town
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   240
	CMD_DO_TOWN_ACTION,               ///< do a action from the town detail window (like advertises or bribe)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   241
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   242
	CMD_SET_ROAD_DRIVE_SIDE,          ///< set the side where the road vehicles drive
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   243
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   244
	CMD_CHANGE_DIFFICULTY_LEVEL,      ///< change the difficult of a game (each setting for it own)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   245
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   246
	CMD_START_STOP_SHIP,              ///< start/stop a ship
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   247
	CMD_SELL_SHIP,                    ///< sell a ship
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   248
	CMD_BUILD_SHIP,                   ///< build a new ship
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   249
	CMD_SEND_SHIP_TO_DEPOT,           ///< send a ship to a depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   250
	CMD_REFIT_SHIP,                   ///< refit the cargo space of a ship
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   251
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   252
	CMD_ORDER_REFIT,                  ///< change the refit informaction of an order (for "goto depot" )
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   253
	CMD_CLONE_ORDER,                  ///< clone (and share) an order
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   254
	CMD_CLEAR_AREA,                   ///< clear an area
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   255
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   256
	CMD_MONEY_CHEAT,                  ///< do the money cheat
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   257
	CMD_BUILD_CANAL,                  ///< build a canal
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   258
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   259
	CMD_PLAYER_CTRL,                  ///< used in multiplayer to create a new player etc.
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   260
	CMD_LEVEL_LAND,                   ///< level land
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   261
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   262
	CMD_REFIT_RAIL_VEHICLE,           ///< refit the cargo space of a train
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   263
	CMD_RESTORE_ORDER_INDEX,          ///< restore vehicle order-index and service interval
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   264
	CMD_BUILD_LOCK,                   ///< build a lock
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   265
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   266
	CMD_BUILD_SIGNAL_TRACK,           ///< add signals along a track (by dragging)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   267
	CMD_REMOVE_SIGNAL_TRACK,          ///< remove signals along a track (by dragging)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   268
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   269
	CMD_GIVE_MONEY,                   ///< give money to an other player
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   270
	CMD_CHANGE_PATCH_SETTING,         ///< change a patch setting
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   271
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   272
	CMD_SET_AUTOREPLACE,              ///< set an autoreplace entry
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   273
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   274
	CMD_CLONE_VEHICLE,                ///< clone a vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   275
	CMD_MASS_START_STOP,              ///< start/stop all vehicles (in a depot)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   276
	CMD_DEPOT_SELL_ALL_VEHICLES,      ///< sell all vehicles which are in a given depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   277
	CMD_DEPOT_MASS_AUTOREPLACE,       ///< force the autoreplace to take action in a given depot
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   278
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   279
	CMD_CREATE_GROUP,                 ///< create a new group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   280
	CMD_DELETE_GROUP,                 ///< delete a group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   281
	CMD_RENAME_GROUP,                 ///< rename a group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   282
	CMD_ADD_VEHICLE_GROUP,            ///< add a vehicle to a group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   283
	CMD_ADD_SHARED_VEHICLE_GROUP,     ///< add all other shared vehicles to a group which are missing
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   284
	CMD_REMOVE_ALL_VEHICLES_GROUP,    ///< remove all vehicles from a group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   285
	CMD_SET_GROUP_REPLACE_PROTECTION, ///< set the autoreplace-protection for a group
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   286
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   287
	CMD_MOVE_ORDER,                   ///< move an order
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   288
	CMD_CHANGE_TIMETABLE,             ///< change the timetable for a vehicle
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   289
	CMD_SET_VEHICLE_ON_TIME,          ///< set the vehicle on time feature (timetable)
44758c09945e (svn r12075) -Codechange: Remove explicit numbering on command enum, and remove blanks from command list where old commands have been removed.
peter1138
parents: 8982
diff changeset
   290
	CMD_AUTOFILL_TIMETABLE,           ///< autofill the timetable
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   291
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   292
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   293
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   294
 * List of flags for a command.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   295
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   296
 * This enums defines some flags which can be used for the commands.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   297
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   298
enum {
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   299
	DC_EXEC            = 0x01, ///< execute the given command
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   300
	DC_AUTO            = 0x02, ///< don't allow building on structures
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   301
	DC_QUERY_COST      = 0x04, ///< query cost only,  don't build.
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   302
	DC_NO_WATER        = 0x08, ///< don't allow building on water
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   303
	DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   304
	DC_AI_BUILDING     = 0x20, ///< special building rules for AI
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   305
	DC_NO_TOWN_RATING  = 0x40, ///< town rating does not disallow you from building
9015
4a44c6974ac1 (svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes
smatz
parents: 8996
diff changeset
   306
	DC_BANKRUPT        = 0x80, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   307
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   308
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   309
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   310
 * Used to combine a StringID with the command.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   311
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   312
 * This macro can be used to add a StringID (the error message to show) on a command-id
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   313
 * (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   314
 * this macro.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   315
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   316
 * @param x The StringID to combine with a command-id
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   317
 */
6987
b0f13039bda2 (svn r9672) -Cleanup: lots of coding style fixes around operands.
rubidium
parents: 6574
diff changeset
   318
#define CMD_MSG(x) ((x) << 16)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   319
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   320
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   321
 * Defines some flags.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   322
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   323
 * This enumeration defines some flags which are binary-or'ed on a command.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   324
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   325
enum {
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   326
	CMD_NO_WATER              = 0x0400, ///< dont build on water
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   327
	CMD_NETWORK_COMMAND       = 0x0800, ///< execute the command without sending it on the network
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   328
	CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   329
	CMD_SHOW_NO_ERROR         = 0x2000, ///< do not show the error message
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   330
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   332
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   333
 * Command flags for the command table _command_proc_table.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   334
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   335
 * This enumeration defines flags for the _command_proc_table.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   336
 */
1804
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   337
enum {
6449
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   338
	CMD_SERVER  = 0x1, ///< the command can only be initiated by the server
e520244dc71e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6338
diff changeset
   339
	CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
8017
8c46e61c510f (svn r11040) -Fix [FS#1179]: removing CMD_AUTO from some commands could remotely trigger an assertion.
rubidium
parents: 7889
diff changeset
   340
	CMD_AUTO    = 0x4, ///< set the DC_AUTO flag on this command
1804
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   341
};
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   342
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   343
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   344
 * Defines the callback type for all command handler functions.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   345
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   346
 * This type defines the function header for all functions which handles a CMD_* command.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   347
 * A command handler use the parameters to act according to the meaning of the command.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   348
 * The tile parameter defines the tile to perform an action on.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   349
 * The flag parameter is filled with flags from the DC_* enumeration. The parameters
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   350
 * p1 and p2 are filled with parameters for the command like "which road type", "which
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   351
 * order" or "direction". Each function should mentioned in there doxygen comments
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   352
 * the usage of these parameters.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   353
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   354
 * @param tile The tile to apply a command on
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   355
 * @param flags Flags for the command, from the DC_* enumeration
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   356
 * @param p1 Additional data for the command
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   357
 * @param p2 Additional data for the command
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   358
 * @return The CommandCost of the command, which can be succeeded or failed.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   359
 */
7439
0c0e2945c890 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
rubidium
parents: 7328
diff changeset
   360
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
3491
4c8427796c64 (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents: 2819
diff changeset
   361
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   362
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   363
 * Define a command with the flags which belongs to it.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   364
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   365
 * This struct connect a command handler function with the flags created with
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   366
 * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   367
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   368
struct Command {
1804
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   369
	CommandProc *proc;
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   370
	byte flags;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   371
};
1804
7810fc0aa941 (svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents: 1796
diff changeset
   372
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   373
/**
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   374
 * Define a callback function for the client, after the command is finished.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   375
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   376
 * Functions of this type are called after the command is finished. The parameters
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   377
 * are from the #CommandProc callback type. The boolean parameter indicates if the
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   378
 * command succeeded or failed.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   379
 *
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   380
 * @param success If the command succeeded or not.
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   381
 * @param tile The tile of the command action
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   382
 * @param p1 Additional data of the command
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   383
 * @param p1 Additional data of the command
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   384
 * @see CommandProc
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   385
 */
4828
9e32eafd4657 (svn r6752) -Codechange: Move command functions from messy functions.h into command.h
Darkvater
parents: 4712
diff changeset
   386
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
8055
07697c701048 (svn r11084) -Documentation [FS#1219]: of command.*. Patch by Progman.
rubidium
parents: 8017
diff changeset
   387
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8056
diff changeset
   388
#endif /* COMMAND_TYPE_H */