Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
reaction_package.cpp File Reference
#include "script/reaction_package.h"
#include <algorithm>
#include <cmath>
#include <format>
#include <limits>
#include <span>
#include <utility>
#include <vector>
Include dependency graph for reaction_package.cpp:

Go to the source code of this file.

Classes

struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::ElementCount
struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::ElementDefinition
struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::ReactionTableDefinition
struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::RuleDefinition
struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::RuleTerm
struct  bicameral::script::anonymous_namespace{reaction_package.cpp}::SpeciesDefinition

Namespaces

namespace  bicameral
namespace  bicameral::script
namespace  bicameral::script::anonymous_namespace{reaction_package.cpp}

Functions

std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::CheckFields (const ScriptValue &table, std::span< const std::string_view > allowed, std::string_view path)
std::expected< const ScriptValue *, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::RequireField (const ScriptValue &table, std::string_view field, std::string_view path)
std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::RequireTable (const ScriptValue &value, std::string_view path)
std::expected< int64_t, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadInteger (const ScriptValue &value, std::string_view path, int64_t minimum, int64_t maximum)
std::expected< int64_t, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadIntegerField (const ScriptValue &table, std::string_view field, std::string_view path, int64_t minimum, int64_t maximum)
std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::CheckRecord (const ScriptValue &value, std::span< const std::string_view > allowed, std::string_view path)
std::expected< ElementDefinition, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadElement (const std::string &name, const ScriptValue &value, const std::string &path)
std::expected< std::vector< ElementCount >, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadComposition (const ScriptValue &value, const std::string &path)
std::expected< SpeciesDefinition, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadSpecies (const std::string &name, const ScriptValue &value, const std::string &path)
std::expected< std::vector< RuleTerm >, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadTerms (const ScriptValue &value, const std::string &path)
std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadOrders (const ScriptValue *orders, std::vector< RuleTerm > &reactants, const std::string &path)
std::expected< DecimalNumber, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadPreExponential (const ScriptValue &value, const std::string &path)
std::expected< sim::ArrheniusRate, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadRate (const ScriptValue &value, const std::string &path)
std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadRuleTerms (const ScriptValue &value, const std::string &path, RuleDefinition &rule)
std::expected< RuleDefinition, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadRule (const std::string &name, const ScriptValue &value, const std::string &path)
template<typename Definition, typename Reader>
std::expected< void, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadCategory (const PackageSetResult &packages, std::string_view category, Reader read, std::vector< Definition > &out)
std::expected< DecimalNumber, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::DigitsToDecimal (std::string digits, int64_t exponent10)
bool bicameral::script::anonymous_namespace{reaction_package.cpp}::IsDigit (char character)
std::expected< int64_t, std::string > bicameral::script::anonymous_namespace{reaction_package.cpp}::ParseExponent (std::string_view text)
std::expected< DecimalNumber, std::string > bicameral::script::ParseDecimal (std::string_view text)
std::expected< ReactionTableDefinition, std::string > bicameral::script::ReadReactionTableDefinition (const PackageSetResult &packages)

Variables

constexpr int64_t bicameral::script::anonymous_namespace{reaction_package.cpp}::EXACT_INTEGER_LIMIT = int64_t{1} << 53
constexpr int64_t bicameral::script::anonymous_namespace{reaction_package.cpp}::UINT32_LIMIT = std::numeric_limits<uint32_t>::max()
constexpr size_t bicameral::script::anonymous_namespace{reaction_package.cpp}::DECIMAL_DIGITS_MAX = 19
constexpr int64_t bicameral::script::anonymous_namespace{reaction_package.cpp}::DECIMAL_EXPONENT_MAX = 999