Pacman Torben Petré
Loading...
Searching...
No Matches
GhostView.h
Go to the documentation of this file.
1#ifndef PACMAN_GHOSTVIEW_H
2#define PACMAN_GHOSTVIEW_H
3
4#include <unordered_map>
5
7#include "EntityView.h"
8
9
10class GhostView final : public EntityView {
11public:
17 explicit GhostView(const std::shared_ptr<logic::GhostModel> &model, int spriteY);
18
22 void render() override;
23
24private:
29 void update(logic::Events event) override;
30
31 std::shared_ptr<logic::GhostModel> ghost;
32
33 std::unordered_map<int, std::vector<sf::IntRect>> animations{};
34 int animationIndex;
35
36 bool frightened = false;
37
48 int animationOffset = 0;
49};
50
51
52#endif //PACMAN_GHOSTVIEW_H
std::shared_ptr< logic::EntityModel > model
Definition EntityView.h:46
EntityView(const std::shared_ptr< logic::EntityModel > &model, float frameDuration)
Definition EntityView.cpp:6
void render() override
Renders the Ghost sprite.
Definition GhostView.cpp:76
GhostView(const std::shared_ptr< logic::GhostModel > &model, int spriteY)
GhostView renders & animates Ghosts.
Definition GhostView.cpp:8
Events
Definition Observer.h:14