scripts.h 1.7 KB

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