Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
VisualState.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
7#include "raylib.h"
8
14 public:
15 mutable Vector3 pos = {0.0f, 0.0f, 0.0f};
16 mutable float angle = 0.0f;
17 mutable float scale = 1.0f;
18 mutable std::vector<std::unique_ptr<IBehavior>> behaviors;
19
20 void update(float dt) const
21 {
22 for (auto& b : behaviors) b->update(dt);
23 for (auto it = behaviors.begin(); it != behaviors.end();) {
24 if ((*it)->isDone())
25 it = behaviors.erase(it);
26 else
27 ++it;
28 }
29 }
30};
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...
std::vector< std::unique_ptr< IBehavior > > behaviors
void update(float dt) const