C++ Project 2016-2017: Arkanoid
world.h
Go to the documentation of this file.
1 
3 #ifndef WORLD_H
4 #define WORLD_H
5 
6 #include "entity/entity.h"
7 #include "entity/wall/wall.h"
8 #include "entity/ball/ball.h"
9 #include "entity/player/player.h"
10 #include "entity/block/block.h"
11 
12 #include <iostream>
13 #include <vector>
14 #include <memory>
15 #include <string>
16 
17 using namespace std;
18 
20 namespace arkanoid {
21 
23  class World : public Entity {
24  private:
25  unique_ptr<Ball> ball;
26  unique_ptr<Player> player;
27  vector<unique_ptr<Wall>> walls;
28  vector<unique_ptr<Block>> blocks;
29 
33  void checkCollisions();
34 
35  public:
39  World();
40 
44  ~World();
45 
49  void update();
50 
54  void draw() const;
55 
61  void addBlock(unique_ptr<arkanoid::Block> block);
62 
68  void addWall(unique_ptr<arkanoid::Wall> wall);
69 
75  void setBall(unique_ptr<arkanoid::Ball> newBall);
76 
82  void setPlayer(unique_ptr<arkanoid::Player> newPlayer);
83 
89  bool levelEnded() const;
90 
95  void reset();
96  };
97 
98 }
99 
100 #endif /* WORLD_H */
The World of the Arkanoid game that contains all Entity objects.
Definition: world.h:23
All the game logic of the Arkanoid game.
Definition: ball.cpp:15
An Entity represents an "object" (like Player, Ball, Block, ...) in the game World.
Definition: entity.h:15