sdl_runtime_compiler git · main
SDL3 game for running and compiling code at runtime
C++ 72.3% C 26.2%git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gzsrc/levels/level.hpp raw
#pragma once
#include <string>
#include "goal.hpp"
#include "scene.hpp"
#include "utils/globals.hpp"
namespace
Nimbin
{
namespace Level
{
namespace Check
{
std::string normalize(const std::string& s);
bool contains_Pattern(const std::string& haystack,
const std::string& needle);
}
struct TokenGrant
{
DynArray<std::string>
choices;
static TokenGrant give(const std::string& text)
{ return { { text } }; }
static TokenGrant choice(std::initializer_list<std::string> options)
{ return { options }; }
};
struct Step
{
DynArray<TokenGrant>
grants{};
Scene::Data scene{};
Goal::Type goal = Goal::AllOf{};
std::string hint{};
std::string details{};
bool reset_carry = false;
int max_ai_words = 5;
};
struct Data
{
DynArray<Step> steps {};
std::string name{};
std::string desc{};
std::string source_file{};
bool dynamic_lib = false;
};
extern Data build_CharCopy();
extern Data build_Sandbox ();
extern Data build_Tutorial();
inline const DynArray<Data>
levels = {
build_CharCopy(),
build_Sandbox (),
build_Tutorial(),
};
inline const Data&
get_Data(size_t i)
{ return levels[i]; }
inline size_t
get_Count()
{ return levels.size(); }
}
} // namespace Nimbin