Skip to content

Commit

Permalink
clang format | remove using namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Wojciech Czerski <[email protected]>
  • Loading branch information
w-czerski committed Jan 14, 2025
1 parent a1c596c commit fad01b7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
16 changes: 7 additions & 9 deletions Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

namespace CsvSpawner
{
using namespace CsvSpawnerUtils;

void CsvSpawnerComponent::Reflect(AZ::ReflectContext* context)
{
CsvSpawnerUtils::CsvSpawnableAssetConfiguration::Reflect(context);
Expand All @@ -31,8 +29,8 @@ namespace CsvSpawner
}

CsvSpawnerComponent::CsvSpawnerComponent(
const AZStd::unordered_map<AZStd::string, CsvSpawnableAssetConfiguration>& spawnableAssetConfiguration,
const AZStd::vector<CsvSpawnableEntityInfo>& spawnableEntityInfo,
const AZStd::unordered_map<AZStd::string, CsvSpawnerUtils::CsvSpawnableAssetConfiguration>& spawnableAssetConfiguration,
const AZStd::vector<CsvSpawnerUtils::CsvSpawnableEntityInfo>& spawnableEntityInfo,
AZ::u64 defaultSeed)
: m_spawnableAssetConfigurations(spawnableAssetConfiguration)
, m_spawnableEntityInfo(spawnableEntityInfo)
Expand All @@ -42,7 +40,7 @@ namespace CsvSpawner

void CsvSpawnerComponent::Activate()
{
if (IsTerrainAvailable())
if (CsvSpawnerUtils::IsTerrainAvailable())
{
AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect();
}
Expand Down Expand Up @@ -85,8 +83,8 @@ namespace CsvSpawner
AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect();
}

bool CsvSpawnerComponent::IsTerrainAvailable()
{
return AzFramework::Terrain::TerrainDataRequestBus::HasHandlers();
}
// bool CsvSpawnerComponent::IsTerrainAvailable()
// {
// return AzFramework::Terrain::TerrainDataRequestBus::HasHandlers();
// }
} // namespace CsvSpawner
12 changes: 5 additions & 7 deletions Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

namespace CsvSpawner
{
using namespace CsvSpawnerUtils;

//! Game component that spawns entities from a CSV file.
//! This component is used to spawn trees, on the first tick.
//! In contrast to the CsvSpawnerEditorComponent, this component's reflection contains all the data it needs to spawn trees ( it is not
Expand All @@ -34,8 +32,8 @@ namespace CsvSpawner
CsvSpawnerComponent() = default;

CsvSpawnerComponent(
const AZStd::unordered_map<AZStd::string, CsvSpawnableAssetConfiguration>& spawnableAssetConfiguration,
const AZStd::vector<CsvSpawnableEntityInfo>& spawnableEntityInfo,
const AZStd::unordered_map<AZStd::string, CsvSpawnerUtils::CsvSpawnableAssetConfiguration>& spawnableAssetConfiguration,
const AZStd::vector<CsvSpawnerUtils::CsvSpawnableEntityInfo>& spawnableEntityInfo,
AZ::u64 defaultSeed);

~CsvSpawnerComponent() = default;
Expand All @@ -47,8 +45,9 @@ namespace CsvSpawner
void Deactivate() override;

private:
AZStd::unordered_map<AZStd::string, CsvSpawnableAssetConfiguration> m_spawnableAssetConfigurations; //!< List of assets to spawn
AZStd::vector<CsvSpawnableEntityInfo> m_spawnableEntityInfo; //!< List of entities to spawn
AZStd::unordered_map<AZStd::string, CsvSpawnerUtils::CsvSpawnableAssetConfiguration>
m_spawnableAssetConfigurations; //!< List of assets to spawn
AZStd::vector<CsvSpawnerUtils::CsvSpawnableEntityInfo> m_spawnableEntityInfo; //!< List of entities to spawn
AZ::u64 m_defaultSeed{ 0 }; //!< Default seed value

AZStd::unordered_map<int, AzFramework::EntitySpawnTicket> m_spawnedTickets;
Expand All @@ -57,6 +56,5 @@ namespace CsvSpawner
void OnTerrainDataCreateEnd() override;
void OnTerrainDataDestroyBegin() override;
bool m_terrainCreatedOnlyOnce{ false }; //!< Is terrain fully generated once
[[nodiscard]] static bool IsTerrainAvailable(); //!< @returns True if current level has terrain, otherwise false.
};
} // namespace CsvSpawner
5 changes: 5 additions & 0 deletions Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "CsvSpawnerUtils.h"

#include "AzFramework/Physics/CollisionBus.h"
#include "AzFramework/Terrain/TerrainDataRequestBus.h"

#include <AzCore/Asset/AssetSerializer.h>
#include <AzCore/Serialization/EditContext.h>
Expand Down Expand Up @@ -292,4 +293,8 @@ namespace CsvSpawner::CsvSpawnerUtils
return tickets;
}

const bool IsTerrainAvailable()
{
return AzFramework::Terrain::TerrainDataRequestBus::HasHandlers();
}
} // namespace CsvSpawner::CsvSpawnerUtils
2 changes: 2 additions & 0 deletions Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ namespace CsvSpawner::CsvSpawnerUtils
const AZStd::string& physicsSceneName = AZStd::string(),
AZ::EntityId parentId = AZ::EntityId());

[[nodiscard]] const bool IsTerrainAvailable(); //!< @returns True if current level has terrain, otherwise false.

}; // namespace CsvSpawner::CsvSpawnerUtils

0 comments on commit fad01b7

Please sign in to comment.