scripts.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef SCRIPTS_H
  2. #define SCRIPTS_H
  3. #include "buysell.h"
  4. #include "dispatchers.h"
  5. #include "galaxy.h"
  6. #include <stack>
  7. class ScriptTerror : public Dispatch {
  8. private:
  9. MoveDispatch * md;
  10. std::shared_ptr<Dispatch> move;
  11. InputDispatch * id;
  12. std::shared_ptr<Dispatch> input;
  13. TraderDispatch * td;
  14. std::shared_ptr<Dispatch> trader;
  15. std::string old_trade_end_empty;
  16. public:
  17. ScriptTerror(Director &);
  18. ~ScriptTerror();
  19. int loops;
  20. int max_loops;
  21. port_pair_type ppt;
  22. void init(void);
  23. void activate(void) override;
  24. void deactivate(void) override;
  25. void input_notify(void);
  26. void move_notify(void);
  27. void trade_notify(void);
  28. void server_prompt(const std::string &prompt) override;
  29. };
  30. class ScriptVoyager : public Dispatch {
  31. private:
  32. MoveDispatch * md;
  33. std::shared_ptr<Dispatch> move;
  34. InputDispatch * id;
  35. std::shared_ptr<Dispatch> input;
  36. void next(void);
  37. public:
  38. ScriptVoyager(Director &);
  39. ~ScriptVoyager();
  40. int loops;
  41. void init(void);
  42. void activate(void) override;
  43. void deactivate(void) override;
  44. void input_notify(void);
  45. void move_notify(void);
  46. void server_prompt(const std::string &prompt) override;
  47. };
  48. class ScriptExplore : public Dispatch {
  49. private:
  50. MoveDispatch * md;
  51. std::shared_ptr<Dispatch> move;
  52. InputDispatch * id;
  53. std::shared_ptr<Dispatch> input;
  54. void next(void);
  55. std::shared_ptr<Dispatch> us;
  56. public:
  57. ScriptExplore(Director &);
  58. ~ScriptExplore();
  59. int loops;
  60. bool infinite;
  61. bool prefer_ports;
  62. int state;
  63. std::stack<sector_type> unknown_warps;
  64. void init(void);
  65. void activate(void) override;
  66. void deactivate(void) override;
  67. void input_notify(void);
  68. void move_notify(void);
  69. bool safe_sector(density d);
  70. void server_prompt(const std::string &prompt) override;
  71. };
  72. #endif