ODR protection for solar system states.

This commit is contained in:
2024-05-03 03:22:23 -04:00
parent d99e5cf176
commit 902048134c
+6 -4
View File
@@ -13,7 +13,8 @@
#include <vector>
#include <map>
namespace
{
struct Coord
{
int x;
@@ -38,14 +39,14 @@ struct WorldDescriptor
using SolarSystemTable= std::map< WorldDescriptor, WorldState >;
using GalaxyTable= std::map< Coord, SolarSystemTable >;
static auto &
auto &
galaxy()
{
static GalaxyTable table;
return table;
}
static auto
auto
getCurrentCoord()
{
const auto &star= *CurStarDescPtr;
@@ -53,7 +54,7 @@ getCurrentCoord()
return pos;
}
static auto &
auto &
getCurrentWorldMasks()
{
const Coord pos= getCurrentCoord();
@@ -68,6 +69,7 @@ getCurrentWorldMasks()
return galaxy()[ pos ][ { planet_index, moon_index } ].ScanRetrieveMask;
}
}
extern "C"
{