Pacman  1.0
Pacman game
Intersection.h
Aller à la documentation de ce fichier.
1 #ifndef INTERSECTION_H
2 #define INTERSECTION_H
3 
4 #include "constants.h"
5 #include <iostream>
6 #include <memory>
7 #include <vector>
16 class Intersection {
17  public:
24  Intersection(int x, int y);
25  ~Intersection();
26 
27  int getX() const;
28  int getY() const;
29  void setUp(std::shared_ptr<Intersection> up);
30  std::shared_ptr<Intersection> getUp() const;
31  void setDown(std::shared_ptr<Intersection> down);
32  std::shared_ptr<Intersection> getDown() const;
33  void setLeft(std::shared_ptr<Intersection> left);
34  std::shared_ptr<Intersection> getLeft() const;
35  void setRight(std::shared_ptr<Intersection> right);
36  std::shared_ptr<Intersection> getRight() const;
37 
43  std::vector<std::shared_ptr<Intersection>> getOptions() const;
50  int getDirection(std::shared_ptr<Intersection> dest) const;
51 
52  private:
53  int x_pixel;
54  int y_pixel;
55  std::shared_ptr<Intersection> up = nullptr;
56  std::shared_ptr<Intersection> down = nullptr;
57  std::shared_ptr<Intersection> left = nullptr;
58  std::shared_ptr<Intersection> right = nullptr;
59 };
60 
61 #endif /* INTERSECTION_H */
Intersection class.
Definition: Intersection.h:16
~Intersection()
Definition: Intersection.cpp:5
void setDown(std::shared_ptr< Intersection > down)
Definition: Intersection.cpp:15
int getY() const
Definition: Intersection.cpp:9
std::shared_ptr< Intersection > left
Definition: Intersection.h:57
std::shared_ptr< Intersection > getUp() const
Definition: Intersection.cpp:13
std::shared_ptr< Intersection > getDown() const
Definition: Intersection.cpp:17
int getX() const
Definition: Intersection.cpp:7
void setLeft(std::shared_ptr< Intersection > left)
Definition: Intersection.cpp:19
int getDirection(std::shared_ptr< Intersection > dest) const
Get the Direction object.
Definition: Intersection.cpp:44
void setUp(std::shared_ptr< Intersection > up)
Definition: Intersection.cpp:11
int y_pixel
Definition: Intersection.h:54
std::shared_ptr< Intersection > getLeft() const
Definition: Intersection.cpp:21
std::shared_ptr< Intersection > right
Definition: Intersection.h:58
std::shared_ptr< Intersection > down
Definition: Intersection.h:56
void setRight(std::shared_ptr< Intersection > right)
Definition: Intersection.cpp:23
std::shared_ptr< Intersection > up
Definition: Intersection.h:55
std::vector< std::shared_ptr< Intersection > > getOptions() const
Get the Options object.
Definition: Intersection.cpp:27
int x_pixel
Definition: Intersection.h:53
std::shared_ptr< Intersection > getRight() const
Definition: Intersection.cpp:25
Intersection(int x, int y)
Construct a new Intersection object.
Definition: Intersection.cpp:3