Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Classes | Functions
cqsp::core::loading Namespace Reference

Classes

class  CityLoader
 This loader has to be loaded after PlanetLoader because it adds the cities to the respectve planets More...
 
class  CountryLoader
 
class  GoodLoader
 
class  HjsonLoader
 
class  PlanetLoader
 
class  RecipeLoader
 
class  SatelliteLoader
 
class  TimezoneLoader
 

Functions

void LoadFields (Universe &universe, Hjson::Value &hjson)
 
Hjson::Value WriteFields (Universe &universe)
 
void LoadNameLists (Universe &universe, Hjson::Value &value)
 
std::optional< OrbitLoadOrbit (const Hjson::Value &values)
 Loads an orbit from a hjson object Note: The caller will have to set the center entity. More...
 
void LoadProvinces (Node &planet, const std::string &text)
 
void LoadAdjProvinces (Universe &universe, Hjson::Value &adjacency_map)
 
void LoadAllProvinces (Universe &universe)
 
Orbit GetOrbit (const std::string &line_one, const std::string &line_two, const double &GM)
 
int GetEpochYear (int year)
 
double GetEpoch (double year, double time)
 
void LoadSatellites (Universe &universe, std::string &string)
 
void LoadTerrainData (Universe &universe, Hjson::Value &value)
 
bool LoadName (const Node &node, const Hjson::Value &value)
 Returns true if name exists More...
 
bool LoadIdentifier (const Node &node, const Hjson::Value &value)
 
bool LoadDescription (const Node &node, const Hjson::Value &value)
 
bool LoadTags (const Node &node, const Hjson::Value &value)
 
bool LoadInitialValues (const Node &node, const Hjson::Value &value)
 Loads all the values that should be on every single data type Returns true if an identifier exists More...
 
components::ResourceLedger HjsonToLedger (Universe &universe, Hjson::Value &hjson)
 
bool VerifyHjsonValueExists (const Hjson::Value &value, const std::string &name, Hjson::Type type)
 
bool VerifyInitialValues (const Hjson::Value &value, const std::map< std::string, Hjson::Type > &map)
 For the values that need to exist More...
 
double ReadUnit (std::string_view value, UnitType unit_type, bool *correct)
 
double ReadUnit (std::string_view value, components::types::UnitType unit_type, bool *correct=nullptr)
 Gets the unit from the value from expected unit type. More...
 
void LoadTechnologies (Universe &universe, Hjson::Value &value)
 

Function Documentation

◆ GetEpoch()

double cqsp::core::loading::GetEpoch ( double  year,
double  time 
)

◆ GetEpochYear()

int cqsp::core::loading::GetEpochYear ( int  year)

◆ GetOrbit()

components::types::Orbit cqsp::core::loading::GetOrbit ( const std::string &  line_one,
const std::string &  line_two,
const double &  GM 
)

◆ HjsonToLedger()

components::ResourceLedger cqsp::core::loading::HjsonToLedger ( Universe universe,
Hjson::Value &  hjson 
)

◆ LoadAdjProvinces()

void cqsp::core::loading::LoadAdjProvinces ( Universe universe,
Hjson::Value &  adjacency_map 
)

◆ LoadAllProvinces()

void cqsp::core::loading::LoadAllProvinces ( Universe universe)

◆ LoadDescription()

bool cqsp::core::loading::LoadDescription ( const Node node,
const Hjson::Value &  value 
)

◆ LoadFields()

void cqsp::core::loading::LoadFields ( Universe universe,
Hjson::Value &  hjson 
)

◆ LoadIdentifier()

bool cqsp::core::loading::LoadIdentifier ( const Node node,
const Hjson::Value &  value 
)

◆ LoadInitialValues()

bool cqsp::core::loading::LoadInitialValues ( const Node node,
const Hjson::Value &  value 
)

Loads all the values that should be on every single data type Returns true if an identifier exists

◆ LoadName()

bool cqsp::core::loading::LoadName ( const Node node,
const Hjson::Value &  value 
)

Returns true if name exists

Returns

◆ LoadNameLists()

void cqsp::core::loading::LoadNameLists ( Universe universe,
Hjson::Value &  value 
)

◆ LoadOrbit()

std::optional< components::types::Orbit > cqsp::core::loading::LoadOrbit ( const Hjson::Value &  values)

Loads an orbit from a hjson object Note: The caller will have to set the center entity.

Parameters
valuesThe hjson input values
Returns
Will return a nullopt if the struct is invalid

◆ LoadProvinces()

void cqsp::core::loading::LoadProvinces ( Node planet,
const std::string &  text 
)

◆ LoadSatellites()

void cqsp::core::loading::LoadSatellites ( Universe universe,
std::string &  string 
)

◆ LoadTags()

bool cqsp::core::loading::LoadTags ( const Node node,
const Hjson::Value &  value 
)

◆ LoadTechnologies()

void cqsp::core::loading::LoadTechnologies ( Universe universe,
Hjson::Value &  value 
)

◆ LoadTerrainData()

void cqsp::core::loading::LoadTerrainData ( Universe universe,
Hjson::Value &  value 
)

◆ ReadUnit() [1/2]

double cqsp::core::loading::ReadUnit ( std::string_view  value,
components::types::UnitType  unit_type,
bool *  correct = nullptr 
)

Gets the unit from the value from expected unit type.

Parameters
value
unit
correct[out] if the unit is of the correct type
Returns

◆ ReadUnit() [2/2]

double cqsp::core::loading::ReadUnit ( std::string_view  value,
UnitType  unit_type,
bool *  correct 
)

◆ VerifyHjsonValueExists()

bool cqsp::core::loading::VerifyHjsonValueExists ( const Hjson::Value &  value,
const std::string &  name,
Hjson::Type  type 
)

◆ VerifyInitialValues()

bool cqsp::core::loading::VerifyInitialValues ( const Hjson::Value &  value,
const std::map< std::string, Hjson::Type > &  map 
)

For the values that need to exist

Returns

◆ WriteFields()

Hjson::Value cqsp::core::loading::WriteFields ( Universe universe)