123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef SCRIPTS_H
- #define SCRIPTS_H
- #include "buysell.h"
- #include "dispatchers.h"
- #include "galaxy.h"
- #include <stack>
- #include "ansicolor.h"
- class ScriptTerror : public Dispatch {
- private:
- MoveDispatch * md;
- std::shared_ptr<Dispatch> move;
- InputDispatch * id;
- std::shared_ptr<Dispatch> input;
- TraderDispatch * td;
- std::shared_ptr<Dispatch> trader;
- std::string old_trade_end_empty;
-
- public:
- ScriptTerror(Director &, const char *called = nullptr);
- ~ScriptTerror();
- int loops;
- int max_loops;
- port_pair_type ppt;
-
- void init(void);
- void activate(void) override;
- void deactivate(void) override;
- void input_notify(void);
- void move_notify(void);
- void trade_notify(void);
- void server_prompt(const std::string &prompt) override;
- };
- class ScriptVoyager : public Dispatch {
- private:
- MoveDispatch * md;
- std::shared_ptr<Dispatch> move;
- InputDispatch * id;
- std::shared_ptr<Dispatch> input;
- void next(void);
-
- public:
- ScriptVoyager(Director &, const char *called = nullptr);
- ~ScriptVoyager();
- int loops;
- void init(void);
- void activate(void) override;
- void deactivate(void) override;
- void input_notify(void);
- void move_notify(void);
- void server_prompt(const std::string &prompt) override;
- };
- class ScriptExplore : public Dispatch {
- private:
- MoveDispatch * md;
- std::shared_ptr<Dispatch> move;
- InputDispatch * id;
- std::shared_ptr<Dispatch> input;
- void next(void);
- std::shared_ptr<Dispatch> us;
- public:
- ScriptExplore(Director &, const char *called = nullptr);
- ~ScriptExplore();
- int loops;
- bool infinite;
- bool prefer_ports;
- bool use_nearest_unknown;
- int state;
- int target;
- std::stack<sector_type> unknown_warps;
-
- void init(void);
- void activate(void) override;
- void deactivate(void) override;
-
- void input_notify(void);
- void move_notify(void);
- void server_prompt(const std::string &prompt) override;
- };
- class ScriptPlanet : public Dispatch {
- private:
- MoveDispatch * md;
- std::shared_ptr<Dispatch> move;
- InputDispatch * id;
- std::shared_ptr<Dispatch> input;
- TraderDispatch * td;
- std::shared_ptr<Dispatch> trader;
- void next(void);
- std::shared_ptr<Dispatch> us;
- const char * foe[3] = {"Fuel", "Organics", "Equipment"};
- public:
- ScriptPlanet(Director &, const char *called = nullptr);
- ~ScriptPlanet();
- int planet;
- int sector;
- int state;
- int current_level;
- int population[3];
- int total_population;
- int amount[3];
- int ship[3];
- int to_make_one[3];
- int support_construction;
- int needs[3];
- int days;
- int current_product;
- sector_type current_buyfrom;
- void init(void);
- void activate(void) override;
- void deactivate(void) override;
- void input_notify(void);
- void move_notify(void);
- void trade_notify(void);
- void server_prompt(const std::string &prompt) override;
- void server_line(const std::string &line, const std::string &raw_line) override;
- void client_input(const std::string &input) override;
- private:
- void clear_amounts(void);
- int place_colonists(void);
- };
- #endif
|