Design Patterns
door.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_DOOR_H_
7 #define CREATIONAL_MAZEPARTS_DOOR_H_
8 
9 #include "map_site_interface.h"
10 #include "room.h"
11 
12 namespace creational
13 {
14 namespace commons
15 {
16 class Door : public MapSiteInterface
17 {
18  public:
19  Door(const Door&);
20  explicit Door(const Room& first_room, const Room& second_room);
21 
22  virtual Door *Clone() const;
23  virtual void Enter() override;
24  void Initialize(const Room& first_room, const Room& second_room);
25  bool is_open() const;
26  Room *OtherSideFrom(const Room& room) const;
27  virtual bool entered() const;
28 
29  private:
30  Room* room1_;
31  Room* room2_;
32  bool is_open_;
33  bool entered_;
34 };
35 }
36 }
37 
38 #endif
39 
bool is_open() const
Definition: door.cc:34
Room * OtherSideFrom(const Room &room) const
Definition: door.cc:44
Definition: bombed_maze_factory.cc:11
Definition: room.h:16
void Initialize(const Room &first_room, const Room &second_room)
Definition: door.cc:28
virtual bool entered() const
Definition: door.cc:53
Definition: map_site_interface.h:13
virtual Door * Clone() const
Definition: door.cc:58
Definition: door.h:16
Door(const Door &)
Definition: door.cc:20
virtual void Enter() override
Definition: door.cc:39