Design Patterns
room.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef CREATIONAL_MAZEPARTS_ROOM_H_
7 #define CREATIONAL_MAZEPARTS_ROOM_H_
8 
9 #include "map_site_interface.h"
10 #include "direction.h"
11 
12 namespace creational
13 {
14 namespace commons
15 {
16 class Room : public MapSiteInterface
17 {
18  public:
19  explicit Room(const int& room_number);
20  Room(const Room& room);
21 
22  virtual Room *Clone() const;
23  virtual void Enter() override;
24  virtual bool entered() const;
25  MapSiteInterface *GetSide(const Direction&) const;
26  int room_number() const;
27  void SetSide(const Direction&, MapSiteInterface*);
28 
29  protected:
31 
32  private:
33  MapSiteInterface* sides_[4];
34  bool enetered_;
35 };
36 }
37 }
38 
39 #endif
40 
Direction
Definition: direction.h:13
MapSiteInterface * GetSide(const Direction &) const
Definition: room.cc:33
Definition: bombed_maze_factory.cc:11
virtual Room * Clone() const
Definition: room.cc:28
void SetSide(const Direction &, MapSiteInterface *)
Definition: room.cc:38
int room_number() const
Definition: room.cc:43
Definition: room.h:16
Definition: map_site_interface.h:13
Room(const int &room_number)
Definition: room.cc:12
virtual bool entered() const
Definition: room.cc:48
int room_number_
Definition: room.h:30
virtual void Enter() override
Definition: room.cc:53