Skip to content

Commit 62358ef

Browse files
committed
remove const& from struct definition
Signed-off-by: Wojciech Czerski <[email protected]>
1 parent 26cb4bd commit 62358ef

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Gems/CsvSpawner/Code/Include/CsvSpawner/CsvSpawnerInterface.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ namespace CsvSpawner
2222
/**
2323
* @brief Flags representing the status of an CsvSpawner::Spawn() operation.
2424
*
25-
* SpawnStatusCode provides various status indicators for entity spawning.
25+
* SpawnStatus provides various status indicators for entity spawning.
2626
* These flags help track whether spawning was successful, stopped, or failed.
2727
*/
28-
enum class SpawnStatusCode : uint8_t
28+
enum class SpawnStatus : uint8_t
2929
{
3030
Success = 0, ///< Operation succeeded.
3131
Fail = 1 << 0, ///< Generic failure.
32-
SpawnStopped = 1 << 1, ///< Spawning was stopped prematurely but not necessarily a failure.
33-
ErrorGenerated = 1 << 2, ///< An error occurred during spawning (potentially recoverable).
32+
Stopped = 1 << 1, ///< Spawning was stopped prematurely but not necessarily a failure.
33+
Warning = 1 << 2, ///< An warning or error occurred during spawning (potentially recoverable).
3434
};
3535

36-
/// Enable bitwise operations for SpawnStatusCode.
37-
AZ_DEFINE_ENUM_BITWISE_OPERATORS(SpawnStatusCode);
36+
/// Enable bitwise operations for SpawnStatus.
37+
AZ_DEFINE_ENUM_BITWISE_OPERATORS(SpawnStatus);
3838

3939
/**
4040
* @brief Structure holding data related to CsvSpawner entity spawning.
@@ -44,9 +44,9 @@ namespace CsvSpawner
4444
*/
4545
struct SpawnInfo
4646
{
47-
const AZStd::vector<CsvSpawnerUtils::CsvSpawnableEntityInfo>& m_entitiesToSpawn; ///< List of entities to spawn.
48-
const AZStd::string& m_physicsSceneName; ///< Name of the physics scene where entities will be spawned.
49-
const AZ::EntityId& m_spawnerParentEntityId; ///< Parent entity ID managing the spawn process.
47+
AZStd::vector<CsvSpawnerUtils::CsvSpawnableEntityInfo> m_entitiesToSpawn; ///< List of entities to spawn.
48+
AZStd::string m_physicsSceneName; ///< Name of the physics scene where entities will be spawned.
49+
AZ::EntityId m_spawnerParentEntityId; ///< Parent entity ID managing the spawn process.
5050
};
5151

5252
/**
@@ -73,7 +73,7 @@ namespace CsvSpawner
7373
* @param m_spawnInfo Struct holding information about entities to be spawned.
7474
* @param m_statusCode Status code indicating success, failure and warnings of the spawn.
7575
*/
76-
virtual void OnEntitiesSpawnFinished(SpawnInfo& m_spawnInfo, SpawnStatusCode& m_statusCode)
76+
virtual void OnEntitiesSpawnFinished(SpawnInfo& m_spawnInfo, SpawnStatus& m_statusCode)
7777
{
7878
}
7979

Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerUtils.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ namespace CsvSpawner::CsvSpawnerUtils
198198
{
199199
SpawnInfo broadcastSpawnInfo =
200200
SpawnInfo{ entitiesToSpawn, physicsSceneName, parentId }; // Spawn Info used in CsvSpawner EBus notify.
201-
SpawnStatusCode spawnStatusCode = SpawnStatusCode::Success; // Spawn Status Code used for CsvSpawner EBus notify - OnEntitiesSpawnFinished.
201+
SpawnStatus spawnStatusCode = SpawnStatus::Success; // Spawn Status Code used for CsvSpawner EBus notify - OnEntitiesSpawnFinished.
202202

203203
// Call CsvSpawner EBus notification - Begin
204204
CsvSpawnerNotificationBus::Broadcast(&CsvSpawnerInterface::OnEntitiesSpawnBegin, broadcastSpawnInfo);
@@ -233,7 +233,7 @@ namespace CsvSpawner::CsvSpawnerUtils
233233
AZ_Error("CsvSpawner", false, "SpawnableAssetConfiguration %s not found", entityConfig.m_name.c_str());
234234

235235
// Add notify code status
236-
spawnStatusCode |= SpawnStatusCode::ErrorGenerated;
236+
spawnStatusCode |= SpawnStatus::Warning;
237237
continue;
238238
}
239239

@@ -264,7 +264,7 @@ namespace CsvSpawner::CsvSpawnerUtils
264264
else
265265
{
266266
// Add notify code status
267-
spawnStatusCode |= SpawnStatusCode::ErrorGenerated;
267+
spawnStatusCode |= SpawnStatus::Warning;
268268

269269
continue; // Skip this entity if we can't find a valid position and
270270
// place on terrain is enabled.
@@ -280,7 +280,7 @@ namespace CsvSpawner::CsvSpawnerUtils
280280
if (view.empty())
281281
{
282282
// Add notify code status
283-
spawnStatusCode |= SpawnStatusCode::ErrorGenerated | SpawnStatusCode::SpawnStopped;
283+
spawnStatusCode |= SpawnStatus::Warning | SpawnStatus::Stopped;
284284

285285
return;
286286
}
@@ -297,7 +297,7 @@ namespace CsvSpawner::CsvSpawnerUtils
297297
if (view.empty())
298298
{
299299
// Add notify code status
300-
spawnStatusCode |= SpawnStatusCode::ErrorGenerated | SpawnStatusCode::SpawnStopped;
300+
spawnStatusCode |= SpawnStatus::Warning | SpawnStatus::Stopped;
301301

302302
return;
303303
}
@@ -310,7 +310,7 @@ namespace CsvSpawner::CsvSpawnerUtils
310310
}
311311

312312
// Check is success spawn
313-
tickets.empty() ? spawnStatusCode |= SpawnStatusCode::Fail : spawnStatusCode |= SpawnStatusCode::Success;
313+
tickets.empty() ? spawnStatusCode |= SpawnStatus::Fail : spawnStatusCode |= SpawnStatus::Success;
314314
// Call CsvSpawner EBus notification - Finished
315315
CsvSpawnerNotificationBus::Broadcast(&CsvSpawnerInterface::OnEntitiesSpawnFinished, broadcastSpawnInfo, spawnStatusCode);
316316

0 commit comments

Comments
 (0)