Pacman Torben Petré
Loading...
Searching...
No Matches
ConcreteFactory.h
Go to the documentation of this file.
1#ifndef CONCRETEFACTORY_H
2#define CONCRETEFACTORY_H
3
4#include <unordered_map>
5#include <vector>
6
8#include "EntityView.h"
9
10
18
19
21public:
27 explicit ConcreteFactory(std::unordered_map<Layer, std::vector<std::shared_ptr<EntityView>>>& views);
28
29
42 std::shared_ptr<logic::PacmanModel> createPacMan(float x, float y, float mapWidth, float mapHeight) override;
43
58 std::shared_ptr<logic::ChasingGhost> createBlinky(float x, float y, float mapWidth, float mapHeight) override;
59
74 std::shared_ptr<logic::AmbushGhost> createPinky(float x, float y, float mapWidth, float mapHeight) override;
89 std::shared_ptr<logic::AmbushGhost> createInky(float x, float y, float mapWidth, float mapHeight) override;
90
105 std::shared_ptr<logic::RandomGhost> createClyde(float x, float y, float mapWidth, float mapHeight) override;
106
120 std::shared_ptr<logic::WallModel> createWall(float x, float y, char type) override;
121
133 std::shared_ptr<logic::CoinModel> createCoin(float x, float y) override;
134
146 std::shared_ptr<logic::FruitModel> createFruit(float x, float y) override;
147
148private:
149 std::unordered_map<Layer, std::vector<std::shared_ptr<EntityView>>>& entityViews;
150};
151
152
153
154
155#endif //CONCRETEFACTORY_H
Layer
Definition ConcreteFactory.h:17
@ PACMAN
Definition ConcreteFactory.h:17
@ FOREGROUND
Definition ConcreteFactory.h:17
@ BACKGROUND
Definition ConcreteFactory.h:17
std::shared_ptr< logic::AmbushGhost > createPinky(float x, float y, float mapWidth, float mapHeight) override
Creates an AmbushGhost and a normal GhostView (no distinction is made between GhostViews).
Definition ConcreteFactory.cpp:32
std::shared_ptr< logic::RandomGhost > createClyde(float x, float y, float mapWidth, float mapHeight) override
Creates a RandomGhost and a normal GhostView (no distinction is made between GhostViews).
Definition ConcreteFactory.cpp:52
std::shared_ptr< logic::FruitModel > createFruit(float x, float y) override
Creates FruitModel and View.
Definition ConcreteFactory.cpp:82
std::shared_ptr< logic::ChasingGhost > createBlinky(float x, float y, float mapWidth, float mapHeight) override
Creates a ChasingGhost and a normal GhostView (no distinction is made between GhostViews).
Definition ConcreteFactory.cpp:22
ConcreteFactory(std::unordered_map< Layer, std::vector< std::shared_ptr< EntityView > > > &views)
Creates a ConreteFactory that can be passed to the World. Requires a views container from LevelState ...
Definition ConcreteFactory.cpp:9
std::shared_ptr< logic::CoinModel > createCoin(float x, float y) override
Creates CoinModel and View.
Definition ConcreteFactory.cpp:72
std::shared_ptr< logic::WallModel > createWall(float x, float y, char type) override
Creates WallModel and View.
Definition ConcreteFactory.cpp:62
std::shared_ptr< logic::AmbushGhost > createInky(float x, float y, float mapWidth, float mapHeight) override
Creates an AmbushGhost and a normal GhostView (no distinction is made between GhostViews).
Definition ConcreteFactory.cpp:42
std::shared_ptr< logic::PacmanModel > createPacMan(float x, float y, float mapWidth, float mapHeight) override
Creates a PacmanModel and View.
Definition ConcreteFactory.cpp:12
Interface for creating game entities.
Definition AbstractFactory.h:21