Remove "TheNew" from TheNewCarlaServer and TheNewCarlaGameModeBase

This commit is contained in:
nsubiron 2019-04-08 15:04:38 +02:00
parent 2e2d8f9a43
commit a220caeee1
10 changed files with 42 additions and 42 deletions

View File

@ -7,7 +7,7 @@
#pragma once
#include "Carla/Sensor/WorldObserver.h"
#include "Carla/Server/TheNewCarlaServer.h"
#include "Carla/Server/CarlaServer.h"
#include "Carla/Util/NonCopyable.h"
#include "Misc/CoreDelegates.h"
@ -27,7 +27,7 @@ public:
void NotifyEndEpisode();
const FTheNewCarlaServer &GetServer() const
const FCarlaServer &GetServer() const
{
return Server;
}
@ -49,7 +49,7 @@ private:
bool bSynchronousMode = false;
FTheNewCarlaServer Server;
FCarlaServer Server;
FWorldObserver WorldObserver;

View File

@ -9,7 +9,7 @@
#include "Carla/Actor/ActorDispatcher.h"
#include "Carla/Recorder/CarlaRecorder.h"
#include "Carla/Sensor/WorldObserver.h"
#include "Carla/Server/TheNewCarlaServer.h"
#include "Carla/Server/CarlaServer.h"
#include "Carla/Settings/EpisodeSettings.h"
#include "Carla/Weather/Weather.h"
@ -264,7 +264,7 @@ public:
private:
friend class ATheNewCarlaGameModeBase;
friend class ACarlaGameModeBase;
friend class FCarlaEngine;
void InitializeAtBeginPlay();

View File

@ -9,7 +9,7 @@
#include "Engine/GameInstance.h"
#include "Carla/Game/CarlaEngine.h"
#include "Carla/Server/TheNewCarlaServer.h"
#include "Carla/Server/CarlaServer.h"
#include "CarlaGameInstance.generated.h"
@ -68,7 +68,7 @@ public:
CarlaEngine.NotifyEndEpisode();
}
const FTheNewCarlaServer &GetServer() const
const FCarlaServer &GetServer() const
{
return CarlaEngine.GetServer();
}

View File

@ -5,9 +5,9 @@
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "Carla.h"
#include "Carla/Game/TheNewCarlaGameModeBase.h"
#include "Carla/Game/CarlaGameModeBase.h"
ATheNewCarlaGameModeBase::ATheNewCarlaGameModeBase(const FObjectInitializer& ObjectInitializer)
ACarlaGameModeBase::ACarlaGameModeBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = true;
@ -22,7 +22,7 @@ ATheNewCarlaGameModeBase::ATheNewCarlaGameModeBase(const FObjectInitializer& Obj
CarlaSettingsDelegate = CreateDefaultSubobject<UCarlaSettingsDelegate>(TEXT("CarlaSettingsDelegate"));
}
void ATheNewCarlaGameModeBase::InitGame(
void ACarlaGameModeBase::InitGame(
const FString &MapName,
const FString &Options,
FString &ErrorMessage)
@ -86,7 +86,7 @@ void ATheNewCarlaGameModeBase::InitGame(
Episode->SetRecorder(Recorder);
}
void ATheNewCarlaGameModeBase::RestartPlayer(AController *NewPlayer)
void ACarlaGameModeBase::RestartPlayer(AController *NewPlayer)
{
if (CarlaSettingsDelegate != nullptr)
{
@ -96,7 +96,7 @@ void ATheNewCarlaGameModeBase::RestartPlayer(AController *NewPlayer)
Super::RestartPlayer(NewPlayer);
}
void ATheNewCarlaGameModeBase::BeginPlay()
void ACarlaGameModeBase::BeginPlay()
{
Super::BeginPlay();
@ -110,7 +110,7 @@ void ATheNewCarlaGameModeBase::BeginPlay()
GameInstance->NotifyBeginEpisode(*Episode);
}
void ATheNewCarlaGameModeBase::Tick(float DeltaSeconds)
void ACarlaGameModeBase::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
@ -118,7 +118,7 @@ void ATheNewCarlaGameModeBase::Tick(float DeltaSeconds)
if (Recorder) Recorder->Tick(DeltaSeconds);
}
void ATheNewCarlaGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
void ACarlaGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Episode->EndPlay();
GameInstance->NotifyEndEpisode();
@ -131,7 +131,7 @@ void ATheNewCarlaGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
}
}
void ATheNewCarlaGameModeBase::SpawnActorFactories()
void ACarlaGameModeBase::SpawnActorFactories()
{
auto *World = GetWorld();
check(World != nullptr);

View File

@ -17,17 +17,17 @@
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "TheNewCarlaGameModeBase.generated.h"
#include "CarlaGameModeBase.generated.h"
/// Base class for the CARLA Game Mode.
UCLASS(HideCategories=(ActorTick))
class CARLA_API ATheNewCarlaGameModeBase : public AGameModeBase
class CARLA_API ACarlaGameModeBase : public AGameModeBase
{
GENERATED_BODY()
public:
ATheNewCarlaGameModeBase(const FObjectInitializer& ObjectInitializer);
ACarlaGameModeBase(const FObjectInitializer& ObjectInitializer);
const UCarlaEpisode &GetCarlaEpisode() const
{

View File

@ -8,7 +8,7 @@
#include "Carla/Game/CarlaEpisode.h"
#include "Carla/Game/CarlaGameInstance.h"
#include "Carla/Game/TheNewCarlaGameModeBase.h"
#include "Carla/Game/CarlaGameModeBase.h"
#include "Carla/Settings/CarlaSettings.h"
#include "Kismet/GameplayStatics.h"
@ -28,7 +28,7 @@ class CARLA_API UCarlaStatics : public UBlueprintFunctionLibrary
public:
UFUNCTION(BlueprintPure, Category="CARLA", meta=(WorldContext="WorldContextObject"))
static ATheNewCarlaGameModeBase *GetGameMode(const UObject *WorldContextObject);
static ACarlaGameModeBase *GetGameMode(const UObject *WorldContextObject);
UFUNCTION(BlueprintPure, Category="CARLA", meta=(WorldContext="WorldContextObject"))
static UCarlaGameInstance *GetGameInstance(const UObject *WorldContextObject);
@ -47,9 +47,9 @@ public:
// -- UCarlaStatics implementation ---------------------------------------------
// =============================================================================
inline ATheNewCarlaGameModeBase *UCarlaStatics::GetGameMode(const UObject *WorldContext)
inline ACarlaGameModeBase *UCarlaStatics::GetGameMode(const UObject *WorldContext)
{
return Cast<ATheNewCarlaGameModeBase>(UGameplayStatics::GetGameMode(WorldContext));
return Cast<ACarlaGameModeBase>(UGameplayStatics::GetGameMode(WorldContext));
}
inline UCarlaGameInstance *UCarlaStatics::GetGameInstance(const UObject *WorldContext)

View File

@ -11,7 +11,7 @@
#include "Carla/Actor/ActorRegistry.h"
#include "Carla/Game/CarlaEpisode.h"
#include "Carla/Game/CarlaGameInstance.h"
#include "Carla/Game/TheNewCarlaGameModeBase.h"
#include "Carla/Game/CarlaGameModeBase.h"
ACollisionSensor::ACollisionSensor(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)

View File

@ -11,7 +11,7 @@
#include "Carla/Actor/ActorRegistry.h"
#include "Carla/Game/CarlaEpisode.h"
#include "Carla/Game/CarlaGameInstance.h"
#include "Carla/Game/TheNewCarlaGameModeBase.h"
#include "Carla/Game/CarlaGameModeBase.h"
AObstacleDetectionSensor::AObstacleDetectionSensor(const FObjectInitializer &ObjectInitializer)
: Super(ObjectInitializer)

View File

@ -5,7 +5,7 @@
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "Carla.h"
#include "Carla/Server/TheNewCarlaServer.h"
#include "Carla/Server/CarlaServer.h"
#include "Carla/Util/DebugShapeDrawer.h"
#include "Carla/Util/OpenDrive.h"
@ -53,10 +53,10 @@ static std::vector<T> MakeVectorFromTArray(const TArray<Other> &Array)
}
// =============================================================================
// -- FTheNewCarlaServer::FPimpl -----------------------------------------------
// -- FCarlaServer::FPimpl -----------------------------------------------
// =============================================================================
class FTheNewCarlaServer::FPimpl
class FCarlaServer::FPimpl
{
public:
@ -140,7 +140,7 @@ private:
// -- Bind Actions -------------------------------------------------------------
// =============================================================================
void FTheNewCarlaServer::FPimpl::BindActions()
void FCarlaServer::FPimpl::BindActions()
{
namespace cr = carla::rpc;
namespace cg = carla::geom;
@ -847,14 +847,14 @@ void FTheNewCarlaServer::FPimpl::BindActions()
#undef CARLA_ENSURE_GAME_THREAD
// =============================================================================
// -- FTheNewCarlaServer -------------------------------------------------------
// -- FCarlaServer -------------------------------------------------------
// =============================================================================
FTheNewCarlaServer::FTheNewCarlaServer() : Pimpl(nullptr) {}
FCarlaServer::FCarlaServer() : Pimpl(nullptr) {}
FTheNewCarlaServer::~FTheNewCarlaServer() {}
FCarlaServer::~FCarlaServer() {}
FDataMultiStream FTheNewCarlaServer::Start(uint16_t RPCPort, uint16_t StreamingPort)
FDataMultiStream FCarlaServer::Start(uint16_t RPCPort, uint16_t StreamingPort)
{
Pimpl = MakeUnique<FPimpl>(RPCPort, StreamingPort);
StreamingPort = Pimpl->StreamingServer.GetLocalEndpoint().port();
@ -862,20 +862,20 @@ FDataMultiStream FTheNewCarlaServer::Start(uint16_t RPCPort, uint16_t StreamingP
return Pimpl->BroadcastStream;
}
void FTheNewCarlaServer::NotifyBeginEpisode(UCarlaEpisode &Episode)
void FCarlaServer::NotifyBeginEpisode(UCarlaEpisode &Episode)
{
check(Pimpl != nullptr);
UE_LOG(LogCarlaServer, Log, TEXT("New episode '%s' started"), *Episode.GetMapName());
Pimpl->Episode = &Episode;
}
void FTheNewCarlaServer::NotifyEndEpisode()
void FCarlaServer::NotifyEndEpisode()
{
check(Pimpl != nullptr);
Pimpl->Episode = nullptr;
}
void FTheNewCarlaServer::AsyncRun(uint32 NumberOfWorkerThreads)
void FCarlaServer::AsyncRun(uint32 NumberOfWorkerThreads)
{
check(Pimpl != nullptr);
/// @todo Define better the number of threads each server gets.
@ -885,12 +885,12 @@ void FTheNewCarlaServer::AsyncRun(uint32 NumberOfWorkerThreads)
Pimpl->StreamingServer.AsyncRun(std::max(2u, StreamingThreads));
}
void FTheNewCarlaServer::RunSome(uint32 Milliseconds)
void FCarlaServer::RunSome(uint32 Milliseconds)
{
Pimpl->Server.SyncRunFor(carla::time_duration::milliseconds(Milliseconds));
}
bool FTheNewCarlaServer::TickCueReceived()
bool FCarlaServer::TickCueReceived()
{
if (Pimpl->TickCuesReceived > 0u)
{
@ -900,13 +900,13 @@ bool FTheNewCarlaServer::TickCueReceived()
return false;
}
void FTheNewCarlaServer::Stop()
void FCarlaServer::Stop()
{
check(Pimpl != nullptr);
Pimpl->Server.Stop();
}
FDataStream FTheNewCarlaServer::OpenStream() const
FDataStream FCarlaServer::OpenStream() const
{
check(Pimpl != nullptr);
return Pimpl->StreamingServer.MakeStream();

View File

@ -13,13 +13,13 @@
class UCarlaEpisode;
class FTheNewCarlaServer
class FCarlaServer
{
public:
FTheNewCarlaServer();
FCarlaServer();
~FTheNewCarlaServer();
~FCarlaServer();
FDataMultiStream Start(uint16_t RPCPort, uint16_t StreamingPort);