Nimbin[12]?SDL & Graphics / sdl_runtime_compiler / src/systems/word_ai_system.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/systems/word_ai_system.hpp 1.5 KB · 47 lines raw
#pragma once

#include "utils/globals.hpp"
#include "text/token.hpp"

namespace
Nimbin
{

struct CarriedLine;
struct Player;


class WordAiSystem
{
    int _max_active_ai = 5;

    void update_Idle  (Text::Token::Data& w, const Player& p, int active_ai_count, double dt);
    void update_Attack(Text::Token::Data& w, const Player& p, CarriedLine& carried,
                       DynArray<Text::TokenPtr>& all_words,
                       DynArray<Text::TokenPtr>& dropped,
                       DynArray<Text::TokenPtr>& released,
                       double dt);
    void update_Flee  (Text::Token::Data& w, const Player& p,
                       DynArray<Text::TokenPtr>& released, double dt);
    void update_Stunned    (Text::Token::Data& w, DynArray<Text::TokenPtr>& released, double dt);
    void update_StolenTrail(Text::Token::Data& w, double dt);

    void release_StolenWords(Text::Token::Data& w, DynArray<Text::TokenPtr>& out);

    void enter_Attack  (Text::Token::Data& w);
    void enter_Flee    (Text::Token::Data& w);
    void enter_Stunned (Text::Token::Data& w);
    void enter_Idle    (Text::Token::Data& w);

    void apply_Locomotion(Text::Token::Data& w, const Vec3& target_vel, double dt);
public:
    void set_MaxActiveAi (int n) { _max_active_ai = n; }

    void update (DynArray<Text::TokenPtr>& words,
                 const Player& player,
                 CarriedLine& carried,
                 DynArray<Text::TokenPtr>& dropped,
                 double dt);
};

} // namespace Nimbin