EgoController.cpp 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <random>
  2. #include "protocol.pb.h"
  3. #include "EgoController.h"
  4. #include "include/EgoInterface.h"
  5. #include "api.h"
  6. #include "../common/peer_connection.h"
  7. #include "control_sensor.h"
  8. #include "EgoWindow.h"
  9. #include "car_sim.h"
  10. #include "out_sim.h"
  11. #ifdef LIDAR_SENSOR
  12. #include "lidar_sim.h"
  13. #endif
  14. #include "radar_sim.h"
  15. #include "EgoClient.h"
  16. CEgoController::CEgoController(IEgoNotify* noitfy)
  17. {
  18. _client = std::make_unique<CEgoClient>(noitfy);
  19. }
  20. void CEgoController::OnCarConnect(int32_t peer)
  21. {
  22. _client->OnCarConnect(peer);
  23. }
  24. void CEgoController::OnCarLeave()
  25. {
  26. _client->OnCarLeave();
  27. }
  28. void CEgoController::Login(std::string account, std::string pass)
  29. {
  30. _client->Login(account, pass);
  31. }
  32. void CEgoController::Start(std::array<IRender*, RenderPosition::ALL>& ar)
  33. {
  34. _client->Start(ar);
  35. }
  36. /*
  37. void CEgoController::ReqCarList()
  38. {
  39. _client->ReqCarList();
  40. }*/
  41. ControlStatus CEgoController::CheckStatus()
  42. {
  43. return _client->CheckStatus();
  44. }