command_func.h

Go to the documentation of this file.
00001 /* $Id: command_func.h 11839 2008-01-13 21:41:24Z rubidium $ */
00002 
00005 #ifndef COMMAND_FUNC_H
00006 #define COMMAND_FUNC_H
00007 
00008 #include "command_type.h"
00009 
00021 static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
00022 
00032 static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
00033 
00041 static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
00042 
00051 #define return_cmd_error(errcode) return CommandCost(errcode);
00052 
00056 CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc);
00057 
00061 bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
00062 
00063 #ifdef ENABLE_NETWORK
00064 
00068 void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
00069 #endif /* ENABLE_NETWORK */
00070 
00078 extern const char *_cmd_text;
00079 extern Money _additional_cash_required;
00080 extern StringID _error_message;
00081 
00085 bool IsValidCommand(uint32 cmd);
00089 byte GetCommandFlags(uint32 cmd);
00093 Money GetAvailableMoneyForCommand();
00094 
00095 #endif /* COMMAND_FUNC_H */

Generated on Mon Sep 22 20:34:15 2008 for openttd by  doxygen 1.5.6