Design Patterns
enchanted_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_ENCHANTED_ROOM_H_
7 #define CREATIONAL_MAZEPARTS_ENCHANTED_ROOM_H_
8 
9 #include "room.h"
10 #include "spell.h"
11 
12 namespace creational
13 {
14 namespace commons
15 {
16 class EnchantedRoom : public Room
17 {
18  public:
20  explicit EnchantedRoom(const int& room_number, const Spell& spell);
21 
22  EnchantedRoom *Clone() const override;
23  bool HasSpell() const;
24  void Initialize(const Spell& spell);
25  Spell PickUpSpell() const;
26 
27  private:
28  Spell* spell_;
29 };
30 }
31 }
32 
33 #endif
34 
void Initialize(const Spell &spell)
Definition: enchanted_room.cc:33
bool HasSpell() const
Definition: enchanted_room.cc:24
Definition: enchanted_room.h:16
Definition: spell.h:15
Definition: bombed_maze_factory.cc:11
int room_number() const
Definition: room.cc:43
Definition: room.h:16
Spell PickUpSpell() const
Definition: enchanted_room.cc:38
EnchantedRoom(const EnchantedRoom &)
Definition: enchanted_room.cc:17
EnchantedRoom * Clone() const override
Definition: enchanted_room.cc:19