Use std::optional instead of sentinel values for absent data
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "BuildingId.h"
|
||||
|
||||
// Deliver-scrap behavior (one half of the old SalvageBehaviorComponent). Scored
|
||||
@@ -7,6 +9,6 @@
|
||||
// SalvagerSystem performs the actual delivery.
|
||||
struct DeliverScrapBehavior
|
||||
{
|
||||
BuildingId deliveryBay = kInvalidBuildingId;
|
||||
float score = 0.0f;
|
||||
std::optional<BuildingId> deliveryBay; // nullopt until a bay is assigned
|
||||
float score = 0.0f;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user