ADD: moved tracklist to parent class

This commit is contained in:
hwinkel
2023-11-10 13:27:17 +01:00
parent 407cb60444
commit 22149dc61d
4 changed files with 23 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include <Entities/Tracklist/Tracklist.hpp>
#include "DirectCommunicationServer.hpp"
#include "Entities/Movement.hpp"
@@ -81,6 +81,9 @@ namespace Entities {
std::shared_ptr<SimCore::SimTrack> OwnShipTrack = nullptr;
std::unique_ptr<TrackList::TrackList> TrackList_ = nullptr;
std::string EntityName_;
SimCore::Kind::EntityKind EntityKind_;
SimCore::Side::EntitySide EntitySide_;

View File

@@ -69,6 +69,7 @@ namespace Entities
BroadcastServer_ = std::make_shared<WHISPER::InternalUDPSender>(GroundTruthAddr, GroundTruthPort);
// BroadcastServer_ = std::make_shared<WHISPER::InternalUDPSender>("239.0.0.1", 10000);
TrackList_ = std::make_unique<TrackList::TrackList>();
}
@@ -287,6 +288,9 @@ namespace Entities
switch (control->Type)
{
case SimCore::IDENTIFY :
{
break;
}
case SimCore::START:
case SimCore::STOP :
case SimCore::SHUT_DOWN :
@@ -297,6 +301,18 @@ namespace Entities
case SimCore::CREATE_ENTITY:
case SimCore::DELETE_ENTITY :
case SimCore::GET_CONTROL:
{
break;
}
case SimCore::GET_TRACKLIST:
{
nlohmann::json j;
this->TrackList_->getJsonTRackList(j);
// WHISPER::StringData(this->OwnShipTrack->getIdentifier(),)
this->CommandCommsServer_->sendMessage(j.dump());
break;
}
break;
};