scripts.cpp 937 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "scripts.h"
  2. #include "logging.h"
  3. ScriptTrader::ScriptTrader(Director &d) : Dispatch(d) {
  4. BUGZ_LOG(fatal) << "ScriptTrader()";
  5. };
  6. ScriptTrader::~ScriptTrader() { BUGZ_LOG(fatal) << "~ScriptTrader()"; }
  7. void ScriptTrader::activate(void) {
  8. // ok, lookup port1 port2
  9. auto port_info = director.galaxy.ports.find(port[0]);
  10. int port0_type = port_info->second.type;
  11. port_info = director.galaxy.ports.find(port[1]);
  12. int port1_type = port_info->second.type;
  13. auto ttr = trade_type_info(port0_type, port1_type);
  14. trades = ttr.trades;
  15. // Ok, what do we do first here?
  16. // I - Info
  17. to_server("I");
  18. }
  19. void ScriptTrader::deactivate(void) {}
  20. void ScriptTrader::server_line(const std::string &line,
  21. const std::string &raw_line) {
  22. if (line == "<Info>") {
  23. }
  24. }
  25. void ScriptTrader::server_prompt(const std::string &prompt){};
  26. void ScriptTrader::client_input(const std::string &cinput){};