SDLPP: Visitor pattern

This commit is contained in:
2021-04-25 13:57:33 +02:00
parent ee82430f82
commit 87970bfc4b
3 changed files with 25 additions and 2 deletions
+4 -1
View File
@@ -105,7 +105,7 @@ void RenderObject::addMovement( double x, double y ) {
void RenderObject::setMovement( double x, double y ) {
movementDirection = { x, y };
}
Vec2D<double> RenderObject::getMovement() {
Vec2D< double > RenderObject::getMovement() {
return movementDirection;
}
void RenderObject::resetMovementX() {
@@ -237,4 +237,7 @@ void RenderObject::setAnimationSpeed( const double fps ) {
animation_fps = fps;
animation_next_frame = animation_next_frame_base = 1000 / fps;
}
void RenderObject::visit( Visitor &visitor ) {
visitor.visit( *this );
}
} // namespace SDLPP