\chapter{Work progression} \section{Zuul bad} \section{Zuul better v1} \subsection{printLocationInfo} This code duplication has been previously avoided with the printRoomInfo() method. It has been renamed to printLocationInfo(), as part of the commit e52a34789, to match the exercise. \subsection{getExit} The exit attributes have been made private and a getter was added in commit 53c427ff3. A switch statement has been used instead of multiple if statements. \subsection{getExitString} This method has been added as part of commit ca65af2e2. \subsection{HashMap, setExit} Room exits are now stored in an HashMap since commit c9d890b9b. The setExits() method has been replaced by setExit() which takes advantages of the HashMap. \subsection{Vertical direction} In commit 4145a5e8c, the getExitString() method has been modified to be able to print the availability of the new exits, used in the stairwell at wing 3. Due to the architecture of these rooms, the side exits that were previously settled to link them have been kept. \subsection{keySet ?} The keySet() method of the class HashMap returns a Set of the keys contained in the map. \subsection{getExitString ?} The getExitString() method returns a String listing the room's exits. To achieve that, it iterates through the exits Map's keys, that is a Set of Strings, appending each one to the String that it returns. \subsection{getLongDescription} The Room class now uses the previously explained getExitString() method and includes the getLongDescription() method that returns the full description of the room since commit e510b08d0. \subsection{Object diagram} \subsubsection{Changes on execution} \section{Zuul with features} \subsection{look} The look command has been added with the commit 698e3cd25. \subsection{eat} The eat command has been added with the commit 40b9b4816. \section{Zuul better v2} \subsection{showAll, showCommands} This modifications are part of the commit 79d33230b. \subsection{Adding commands} Adding new commands would not require modifying the printHelp() method anymore. However, adding new commands and related functions would still require editing the Game class and its processCommand() method. \subsection{getCommandList} The command list is not printed in the CommandWords class anymore. Instead, this class returns a String, forwarded by the Parser class, that is then printed in the Game class, thanks to commit 5f1d0ada2. \subsection{Comparison with reference} The printLocationInfo() method, used only twice, has been trimmed by the commit 590a932e5 and has been replaced by a call to the getLongDescription() method of the Room class. A missing getter for the Room description has been added as part of the commit f84606424. The loop building the command list String has been modified to use an Iterator with the commit 0c5793abf. \subsection{StringBuilder} The command list and the exit list are now created using a StringBuilder since commit ee5ec33aa. This avoids the creation of a new String object at each concatenation, and thus allows better performances. \subsection{Room objects} Rooms are now stored in an HashMap since commit f64f1ffb0, so they can be passed to any method in any class. \section{Zuul with images} \subsection{Game, GameEngine, UserInterface} The following methods was implemented as part of commit 54e102463. \subsubsection{Game} The constructor of this class instantiates the GameEngine and the UserInterface, and set the output of the first to the second. \subsubsection{GameEngine} This class contains the attributes and methods previously contained in the Game class. Instead of printing to the standard console output, it prints to the GUI. \subsubsection{UserInterface} This class implements the graphical user interface of the game. It basically creates the different window components and provides methods to interact with them. \subsection{Parser/Scanner} Since commands are entered through a text field instead of the console, the use of Scanner that read from the standard system input is not required anymore. \subsection{addActionListener() and actionPerformed()} The addActionListener() of an object x takes as parameter an object y that have a actionPerformed() method. When an action event occurs on x, this method on y is called and an ActionEvent is passed as parameter. The actionPerformed() method then does the appropriate action according to the event that happened. \subsection{Add a button} A help button was added with commit 7f153a4c1. The processCommand() method was modified to take the command String as parameter instead of reading it only from the text field, and the actionPerformed() method was modified accordingly to forward the command. \section{Zuul MVC} \subsection{Structure} Three packages were made to help matching this architecture: model, view and controller. The model package contains the objects storing the game state and various elements representing a data, that is to say the Game, Room and Command classes. The view package contains the user interfaces, rich and console, that displays the game state to the user and enable him to interact with the game by firing events to the controller. The controller consists of several classes and represents the logic part of the program, which are the GameEngine, the Interpret, the Parser and the Performer. They handle the events created by the user's actions and modify the Game model accordingly, refreshing the view to display the new game state. Several internal modifications in the existing classes were made in order to separate the logic from the data storage as part of commit bd639caa0. \section{Zuul with items v1} \subsection{Item} Item support was added as part of commit 3fc06f393. \subsection{item description} \subsection{items} \subsection{Collection choice} \section{Zuul with history} \subsection{back} \subsection{back test} \subsection{back back} \subsection{Stack} \section{Zuul with tests} \subsection{tests} \subsubsection{Automatic tests} \subsection{test command} \section{Zuul with items v2} \subsection{Player} \subsection{take, drop} \subsection{Carry several items} \subsection{ItemList} \subsection{Maximum weight} \subsection{Inventory} \subsection{Magic cookie} \subsection{Tests} \section{Zuul with enums} \subsection{switch} \subsection{look with enum} \subsection{help with enum} \section{Zuul extended} \subsection{Time limit} \subsubsection{Real time} \subsection{GUI} \subsection{Trap door} \subsection{Beamer} \subsection{Locked door} \subsection{Tests} \subsection{Transporter room} \subsubsection{alea} \subsection{Inheritance} \subsection{Abstract Command} \subsection{Packages} \subsection{Character} \subsubsection{Moving character} \section{Zuul without BlueJ} \subsection{main} \subsection{jar} \subsection{JApplet} \section{Zuul awesome} \subsection{Room sides} \subsection{Quests} \subsection{Better GUI} \subsection{Music} \subsection{Scenes} \subsection{Save/load game} \subsubsection{save} \subsubsection{load} \subsection{More tests} \section{Not Zuul} \subsection{maximum} \subsection{static} \subsubsection{Properties} \subsubsection{numberOfInstances} \subsection{currentTimeMillis}