ADD: added new version of Orders and a first use in the entity base class
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "DirectCommunicationServer.hpp"
|
||||
#include "Entities/Movement.hpp"
|
||||
#include "Orders/MoveOrder.hpp"
|
||||
#include "SimCore/Messages/SimTrack.hpp"
|
||||
#include "WHISPER/InternalUDPListener.hpp"
|
||||
#include "WHISPER/InternalUDPSender.hpp"
|
||||
@@ -53,30 +54,28 @@ namespace Entities
|
||||
void Entity::setPosition(SimCore::Position pos)
|
||||
{
|
||||
OwnShipTrack->setPosition(pos);
|
||||
SimCore::SimTrack newSimTrack(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY,EntityKind_);
|
||||
newSimTrack.setPosition(pos);
|
||||
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
|
||||
moveorder.setPosition(pos);
|
||||
|
||||
}
|
||||
void Entity::setSpeed(double val)
|
||||
{
|
||||
OwnShipTrack->Speed.setValue(val);
|
||||
SimCore::SimTrack newSimTrack(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY,EntityKind_);
|
||||
newSimTrack.Speed.setValue(val);
|
||||
MovemtServer_->sendMessage(newSimTrack.buildMessage().serialize());
|
||||
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
|
||||
|
||||
}
|
||||
void Entity::setCourse(double val)
|
||||
{
|
||||
OwnShipTrack->Course.setValue(val);
|
||||
SimCore::SimTrack newSimTrack(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY,EntityKind_);
|
||||
newSimTrack.Course.setValue(val);
|
||||
LOG_S(INFO)<< "NEW Course: "<< val;
|
||||
MovemtServer_->sendMessage(newSimTrack.buildMessage().serialize());
|
||||
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
|
||||
moveorder.Course.setValue(val);
|
||||
MovemtServer_->sendMessage(moveorder.buildMessage().serialize());
|
||||
|
||||
}
|
||||
void Entity::setPitch( double val)
|
||||
{
|
||||
OwnShipTrack->Pitch.setValue(val);
|
||||
SimCore::SimTrack newSimTrack(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY,EntityKind_);
|
||||
newSimTrack.Pitch.setValue(val);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user