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
6
#include "
behaviors/IBehavior.hpp
"
7
#include "raylib.h"
8
13
class
VisualState
{
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
};
IBehavior.hpp
VisualState
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...
Definition
VisualState.hpp:13
VisualState::angle
float angle
Definition
VisualState.hpp:16
VisualState::pos
Vector3 pos
Definition
VisualState.hpp:15
VisualState::scale
float scale
Definition
VisualState.hpp:17
VisualState::behaviors
std::vector< std::unique_ptr< IBehavior > > behaviors
Definition
VisualState.hpp:18
VisualState::update
void update(float dt) const
Definition
VisualState.hpp:20
gui
src
core
VisualState.hpp
Generated by
1.9.8