ODR protection for solar system states.
This commit is contained in:
@@ -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"
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user