Question: 1) Factory Method Pattern We are implementing a Maze game that will contain multiple maze rooms. We will create an abstract MazeRoom class to be

 1) Factory Method Pattern We are implementing a Maze game that

1) Factory Method Pattern We are implementing a Maze game that will contain multiple maze rooms. We will create an abstract MazeRoom class to be the superclass of a hierarchy of different maze rooms. Such a room could contain a variety of methods and fields such as a description() method that returns a string, briefly describing the room. Rooms could also contain a variety of objects, but for simplicity let's focus on doors. Any given room will contain a List of MazeDoors, which is going to be an abstract superclass for a hierarchy of doors. There will be different types of doors and new types could be conceived as the designers of the game come up with new crazy ideas. For now we know that there will be simple doors which don't have a lock, but there will also be locked doors, and to unlock them you must provide a numeric code (integer) or a password (string). And we also know there will be doors with quizzes printed on them... and the solution to the quiz (lets for simplicity say it will be a string) will need to be provided to unlock the door. The doors with quizzes will need to include a functionality to 'show' the quiz. In the case of the doors without quizzes the answer will be hidden in other parts of the room. There will also be many type of rooms, for now we have 'wooden rooms' which will contain normal doors, there will be 'steel rooms' which will contain locked doors that open with numeric code, there will be 'brick rooms' which will contain locked doors that open with a password (string) and there will be 'glass rooms' which will contain doors with quizzes. We don't know which other rooms and doors could be created in the future thus we want to make our design as flexible as possible using the Factory Method pattern. The idea is that each subclass in the rooms hierarchy will know what type of doors it will contain and will be able to create them through a 'createDoor() method. With the provided information design and implement class hierarchies for the rooms and doors. Rooms should be able to create their own type of doors in the constructor given the information of where to put them. Doors need to provide the functionality to open, unlock and show the quiz. As you may notice, you have only been given very general information about the game and what design decisions to make. Feel free to incorporate your own design decision and elements to the game as you see fit. For extra points feel free to apply other patterns. With this question you may include a document describing any relevant design decision, the UML diagram if you didn't use Blue), and a description of any other pattern that you applied. 1) Factory Method Pattern We are implementing a Maze game that will contain multiple maze rooms. We will create an abstract MazeRoom class to be the superclass of a hierarchy of different maze rooms. Such a room could contain a variety of methods and fields such as a description() method that returns a string, briefly describing the room. Rooms could also contain a variety of objects, but for simplicity let's focus on doors. Any given room will contain a List of MazeDoors, which is going to be an abstract superclass for a hierarchy of doors. There will be different types of doors and new types could be conceived as the designers of the game come up with new crazy ideas. For now we know that there will be simple doors which don't have a lock, but there will also be locked doors, and to unlock them you must provide a numeric code (integer) or a password (string). And we also know there will be doors with quizzes printed on them... and the solution to the quiz (lets for simplicity say it will be a string) will need to be provided to unlock the door. The doors with quizzes will need to include a functionality to 'show' the quiz. In the case of the doors without quizzes the answer will be hidden in other parts of the room. There will also be many type of rooms, for now we have 'wooden rooms' which will contain normal doors, there will be 'steel rooms' which will contain locked doors that open with numeric code, there will be 'brick rooms' which will contain locked doors that open with a password (string) and there will be 'glass rooms' which will contain doors with quizzes. We don't know which other rooms and doors could be created in the future thus we want to make our design as flexible as possible using the Factory Method pattern. The idea is that each subclass in the rooms hierarchy will know what type of doors it will contain and will be able to create them through a 'createDoor() method. With the provided information design and implement class hierarchies for the rooms and doors. Rooms should be able to create their own type of doors in the constructor given the information of where to put them. Doors need to provide the functionality to open, unlock and show the quiz. As you may notice, you have only been given very general information about the game and what design decisions to make. Feel free to incorporate your own design decision and elements to the game as you see fit. For extra points feel free to apply other patterns. With this question you may include a document describing any relevant design decision, the UML diagram if you didn't use Blue), and a description of any other pattern that you applied

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!