Nimbin[12]?SDL & Graphics / sdl_runtime_compiler / src/levels/goal.hpp

sdl_runtime_compiler git · main

SDL3 game for running and compiling code at runtime

sdl3 c++ compiler dlopen cmake · first commit 2026-04-19 · last commit 2026-07-03 (3 months ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-runtime-compiler

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.gz
src/levels/goal.hpp 1.2 KB · 65 lines raw
#pragma once

#include <string>
#include <variant>

#include "entities/pult.hpp"
#include "utils/globals.hpp"

namespace
Nimbin
{

namespace Goal
{

struct ReachPlate    { std::string tag; };
struct PressButton   { PultAction action; };
struct CollectWord   { std::string text; };
struct DroppedWord   {};
struct ShotWord      {};
struct CompilePattern{ std::string pattern; };
struct AiWordDefeated{ std::string text; };


struct AnyOf;
struct AllOf;


using Type = std::variant<
    ReachPlate,
    PressButton,
    CollectWord,
    DroppedWord,
    ShotWord,
    AiWordDefeated,
    CompilePattern,
    AnyOf,
    AllOf
>;


struct AnyOf { DynArray<Type> options; };

struct AllOf { DynArray<Type> options; };


struct Context {
    DynArray<std::string> active_plate_tags;
    DynArray<PultAction>  buttons_pressed_this_step;
    DynArray<std::string> picked_up_this_step;
    DynArray<std::string> ai_words_defeated_this_step;

    bool dropped_this_step    {false};
    bool shot_this_step       {false};
    bool compile_ok_this_step {false};

    std::string editor_normalized;
};


bool is_Satisfied(const Type& g, const Context& ctx);

} // namespace Goal

} // namespace Nimbin