src/command.h
branchnoai
changeset 9694 e72987579514
parent 9641 855e32c08c9b
child 9703 d2a6acdbd665
equal deleted inserted replaced
9693:31fcaa5375a1 9694:e72987579514
   192 };
   192 };
   193 
   193 
   194 static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
   194 static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
   195 static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
   195 static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
   196 
   196 
   197 static const CommandCost CMD_ERROR = CommandCost((StringID)INVALID_STRING_ID);
   197 static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
   198 
   198 
   199 #define return_cmd_error(errcode) do { return CommandCost((StringID)(errcode)); } while (0)
   199 #define return_cmd_error(errcode) do { return CommandCost(errcode); } while (0)
   200 
   200 
   201 /* command.cpp */
   201 /* command.cpp */
   202 typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
   202 typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
   203 CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
   203 CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
   204 bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
   204 bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);