From cf9be831cf6fac6dedb9e7e9216d57fb0f4a642e Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 5 Jun 2014 00:40:36 +0200 Subject: Update report --- report/document.tex | 12 +-- report/organization.tex | 5 - report/packages.tex | 19 +++- report/progression.tex | 255 ++++++++++++++++++++++++------------------------ report/project.tex | 3 +- report/tools.tex | 3 + report/userguide.tex | 61 +++++++++++- 7 files changed, 213 insertions(+), 145 deletions(-) delete mode 100644 report/organization.tex diff --git a/report/document.tex b/report/document.tex index c3ec4d1..405cb08 100644 --- a/report/document.tex +++ b/report/document.tex @@ -16,6 +16,8 @@ \input{style/pascience-listings} +\usepackage{hyperref} + %%%%%%%%%%%%%%%%%%%% %% DOCUMENT @@ -41,10 +43,6 @@ \cleardoublepage -\input{organization} - -\cleardoublepage - \input{packages} \cleardoublepage @@ -61,10 +59,10 @@ \end{appendices} -\cleardoublepage +%\cleardoublepage -\bibliographystyle{unsrt} -\bibliography{bibliography} +%\bibliographystyle{unsrt} +%\bibliography{bibliography} \end{document} \ No newline at end of file diff --git a/report/organization.tex b/report/organization.tex deleted file mode 100644 index 4ca7bc6..0000000 --- a/report/organization.tex +++ /dev/null @@ -1,5 +0,0 @@ -\chapter{Work organization} - -\section{Schedule} - -\section{Task assignments} diff --git a/report/packages.tex b/report/packages.tex index dde1d0b..e8bec09 100644 --- a/report/packages.tex +++ b/report/packages.tex @@ -5,23 +5,34 @@ were used in this project. \section{StretchIcon} -StretchIcon enables the resize of the Room illustration according to the +StretchIcon enabled the resize of the Room illustration according to the window's size in the rich Swing GUI, keeping a correct ratio. -\section{Guava} +\section{Guava} -\section{Intrinsic Map} +Guava, from Google, contains several collections, caching, primitives support, +concurrency, annotations and string processing utilities. +\section{Lombok} -\section{Google Web Toolkit} +Lombok helped avoiding writing dozens of getters and setters by replacing them +with shorter annotations. +\section{Intrinsic Map} +As Items were already containing there names in a field, HashMap +were redundant. IntrinsicMap and the Mappable interface were created to +avoid this redundance. +\section{Google Web Toolkit} +The Google Web Toolkit was used to create the web version of the game. +It permitted the compilation of Java sources to Javascript code executable +directly inside a web browser, without requiring the Java Virtual Machine. \section{JSON Simple} diff --git a/report/progression.tex b/report/progression.tex index cca0477..cd3f4ec 100644 --- a/report/progression.tex +++ b/report/progression.tex @@ -4,48 +4,48 @@ \subsection{printLocationInfo} -e52a34789 - This code duplication has been previously avoided with the +e52a34789 - Pacien - This code duplication has been previously avoided with the printRoomInfo() method. It has been renamed to printLocationInfo() to match the exercise. \subsection{getExit} -53c427ff3 - The exit attributes have been made private and a getter has been -added. +53c427ff3 - Pacien - The exit attributes have been made private and a getter has +been added. A switch statement has been used instead of multiple if statements. \subsection{getExitString} -ca65af2e2 - This method, which returns a String containing the informations -about the Room's exits, has been added. +ca65af2e2 - Pacien - This method, which returns a String containing the +informations about the Room's exits, has been added. \subsection{HashMap, setExit} -c9d890b9b - Room exits are now stored in an HashMap. The setExits() method has -been replaced by setExit() which takes advantages of the HashMap. +c9d890b9b - Pacien - Room exits are now stored in an HashMap. The setExits() +method has been replaced by setExit() which takes advantages of the HashMap. \subsection{Vertical direction} -4145a5e8c - The getExitString() method has been modified to be able to +4145a5e8c - Pacien - 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 +Benoît - The keySet() method of the class HashMap returns a Set of the keys associated to values stored in the Map. \subsection{getExitString ?} -The getExitString() method returns a String listing the Room's exits. +Benoît - The getExitString() method returns a String listing the Room's exits. To achieve that, it iterates through the exits Map's keys, which is a Set of String-s, appending each one to the String that it returns. \subsection{getLongDescription} -e510b08d0 - The Room class now uses the previously explained getExitString() -method and includes the getLongDescription() method that returns the full description of +e510b08d0 - Pacien - The Room class now uses the previously explained +getExitString() method and includes the getLongDescription() method that returns the full description of the room. @@ -53,12 +53,13 @@ the room. \subsection{look} -698e3cd25 - The look command, which prints informations about the current Room, -has been added. +698e3cd25 - Benoît - The look command, which prints informations about the +current Room, has been added. \subsection{eat} -40b9b4816 - The eat command, that just prints a special message, has been added. +40b9b4816 - Benoît - The eat command, that just prints a special message, has +been added. This command has then been deleted later in the development since it was useless in the scenario. @@ -66,77 +67,79 @@ useless in the scenario. \subsection{showAll, showCommands} -79d33230b - Theses methods have been implemented. +79d33230b - Pacien - Theses methods have been implemented. \subsection{Adding commands} -Adding new commands would not require modifying the printHelp() method anymore. +Benoît - 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} -5f1d0ada2 - The command list is not printed in the CommandWords class anymore. +5f1d0ada2 - Benoît - 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. \subsection{Comparison with reference} -590a932e5 - The printLocationInfo() method, used only twice, has been trimmed -and has been replaced by a call to the getLongDescription() method of the Room +590a932e5 - Pacien - The printLocationInfo() method, used only twice, has been +trimmed and has been replaced by a call to the getLongDescription() method of the Room class. -f84606424 - A missing getter for the Room description has been added. +f84606424 - Benoît - A missing getter for the Room description has been added. -0c5793abf - The loop building the command list String has been modified to use -an Iterator. +0c5793abf - Benoît - The loop building the command list String has been modified +to use an Iterator. \subsection{StringBuilder} -ee5ec33aa - The command list and the exit list are now created using a +ee5ec33aa - Benoît - The command list and the exit list are now created using a StringBuilder. This avoids the creation of a new String object at each concatenation, and thus allows better performances. \subsection{Room objects} -f64f1ffb0 - Rooms are now stored in an HashMap, so they can be passed to any -method in any class. +f64f1ffb0 - Pacien - Rooms are now stored in an HashMap, so they can be passed +to any method in any class. \section{Zuul with images} \subsection{Game, GameEngine, UserInterface} -54e102463 - The methods have been implemented. +54e102463 - Pacien - The methods have been implemented. \subsubsection{Game} -The constructor of this class instantiates the GameEngine and the UserInterface, -and sets the output of the first to the second. +Pacien - The constructor of this class instantiates the GameEngine and the +UserInterface, and sets the output of the first to the second. \subsubsection{GameEngine} -This class contains the attributes and methods previously contained in the Game -class. +Pacien - 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 Swing GUI. \subsubsection{UserInterface} -This class implements the graphical user interface of the game. It basically -creates the different window components and provides methods to +Pacien - 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 for the +Pacien - 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 for the Swing GUI. \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 +Pacien - 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 @@ -144,8 +147,8 @@ event that happened. \subsection{Add a button} -7f153a4c1 - A help button has been added. The processCommand() method has been -modified to take the command String as a parameter instead of reading it only +7f153a4c1 - Benoît - A help button has been added. The processCommand() method +has been modified to take the command String as a parameter instead of reading it only from the text field, and the actionPerformed() method has been modified accordingly to forward the command. @@ -154,8 +157,8 @@ accordingly to forward the command. \subsection{Structure} -Three packages were made to help matching this architecture: model, view and -controller. +Pacien - 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. @@ -169,8 +172,8 @@ 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. -bd639caa0 - Several internal modifications in the existing classes were made in -order to separate the logic from the data storage. +bd639caa0 - Pacien - Several internal modifications in the existing classes were +made in order to separate the logic from the data storage. Later in the development, it has been found that this pattern is not easily usable in a language like Java, and has been replaced by a @@ -183,62 +186,62 @@ package has been kept appart. \subsection{Item} -3fc06f393 - Item support has been added. +3fc06f393 - Pacien - Item support has been added. \subsection{item description} -In order to respect the MVC pattern, the Performer controller should get the -description from the Item model and ask the View to display it. +Pacien - In order to respect the MVC pattern, the Performer controller should +get the description from the Item model and ask the View to display it. \subsection{items} -04f03d128 - A Room can now contain multiple items, which are stored in an -HashMap. +04f03d128 - Pacien - A Room can now contain multiple items, which are stored in +an HashMap. \subsection{Collection choice} -The collection chosen to implement the multiple items support was the HashMap in -order to associate an item name (String) to an Item, so that the user is able +Pacien - The collection chosen to implement the multiple items support was the +HashMap in order to associate an item name (String) to an Item, so that the user is able to perform actions on a particular one (take, drop, use, etc\ldots). \section{Zuul with history} \subsection{back} -f218bf5fa - The back command has been implemented. +f218bf5fa - Pacien - The back command has been implemented. \subsection{back test} -The back command works even with any parameter. We will check this later with -``zuul-with-enums``. +Benoît - The back command works even with any parameter. We will check this +later with ``zuul-with-enums``. \subsection{back back} -When the user enters back twice, he goes two rooms backward. This is working -correctly. +Benoît - When the user enters back twice, he goes two rooms backward. This is +working correctly. \subsection{Stack} -The Stack class represents a last-in-first-out (LIFO) stack of objects. The push() -method allows to add and element at the top of the stack and the pop() method +Pacien - The Stack class represents a last-in-first-out (LIFO) stack of objects. +The push() method allows to add and element at the top of the stack and the pop() method allows to retrieve the top item and removes it. -A condition checks whether the Stack is empty before calling the pop() method, -so that the program does not throw an Exception. This solves the case when the +A condition checks whether the Stack is empty before calling the pop() +method, so that the program does not throw an Exception. This solves the case when the player is at the starting point. \section{Zuul with tests} \subsection{tests} -In the current version of the game, the outputs of commands such as help or quit -might be easily tested. Furthermore, movement from Room-s to Room-s, and arising +Benoît - In the current version of the game, the outputs of commands such as +help or quit might be easily tested. Furthermore, movement from Room-s to Room-s, and arising modifications on the model, can also be candidates for testing. \subsubsection{Automatic tests} -Functionalities of the program can be tested automatically using unit testing -for classes and methods, and interactive testing to simulate the user's +Pacien - Functionalities of the program can be tested automatically using unit +testing for classes and methods, and interactive testing to simulate the user's interactions. Unit tests can later be implemented using the JUnit testing framework. @@ -248,7 +251,8 @@ interpreting commands from a text file. \subsection{test command} -967f40d71 - The test command has been implemented by modifying the Console view. +967f40d71 - Pacien - The test command has been implemented by modifying the +Console view. Instead of reading commands from the user's input from the console, the Scanner reads the commands from a text file. @@ -258,8 +262,8 @@ command line flag that can be used by executing the program from a terminal with \subsubsection{test files} -Three test files have been created. The first one tests simple commands such as -help and quit, the second one explores all rooms, and the last one executes all actions +Benoît - Three test files have been created. The first one tests simple commands +such as help and quit, the second one explores all rooms, and the last one executes all actions to win the game. @@ -267,68 +271,69 @@ to win the game. \subsection{Player} -92f671b84 - The current Room and the previous Room-s were moved from the Game -class to the Player class. +92f671b84 - Benoît - The current Room and the previous Room-s were moved from +the Game class to the Player class. \subsection{take, drop} -5ddb6df63 - The take and drop commands have been implemented. An Inventory -interface, used by the Room and Player classes, was added. Items are stored +5ddb6df63 - Pacien - The take and drop commands have been implemented. An +Inventory interface, used by the Room and Player classes, was added. Items are stored using HashMaps, and a moveItem procedure was added to the Performer. \subsection{Carry several items} -5ddb6df63 - The possibility to carry multiple Item-s was already implemented. +5ddb6df63 - Pacien - The possibility to carry multiple Item-s was already +implemented. \subsection{ItemList} -db2c22c9b - The ItemList was implemented as the Inventory class. +db2c22c9b - Pacien - The ItemList was implemented as the Inventory class. The Inventory is no longer an interface. \subsection{Maximum weight} -b8771ccb2 - The maximum carryable weight has been implement. +b8771ccb2 - Benoît - The maximum carryable weight has been implement. In order to achieve this, a getTotalWeight() function was added to the Inventory class. \subsection{Inventory} -a3f6ce16e - The Player's Inventory Item-s listing has been implemented, using -the recently added listing utility class. +a3f6ce16e - Pacien - The Player's Inventory Item-s listing has been implemented, +using the recently added listing utility class. \subsection{Magic cookie} -35ee3b1ee - Since there are already too many commands, the carryable weight -expansion was implemented in a smarter way using a negative weight +35ee3b1ee - Pacien - Since there are already too many commands, the carryable +weight expansion was implemented in a smarter way using a negative weight item. We could have instead increased the maximum carryable weight with a setter on the Player class, called by the Performer with the ``eat'' command. \subsection{Tests} -7b610fc05 - The commands test file was updated. +7b610fc05 - Benoît - The commands test file was updated. \section{Zuul with enums} \subsection{switch} -d24dd6cc9 - The String switch statement was replaced by an enum switch. Instead -of using an HashMap to match entered Strings to the corresponding enum value, +d24dd6cc9 - Pacien - The String switch statement was replaced by an enum switch. +Instead of using an HashMap to match entered Strings to the corresponding enum value, the valueOf() method was used. \subsection{help with enum} -159b168b2 - The help command now generates the list of the available commands -from the enum. +159b168b2 - Pacien - The help command now generates the list of the available +commands from the enum. \section{Zuul extended} \subsection{Time limit} -2fee72805 - The limit was implemented as a steps limit for the player. When -this limit is reached, the game quits with a message. +2fee72805 - Benoît - The limit was implemented as a steps limit for the player. +When this limit is reached, the game quits with a message. This limit can be activated by initiating a new game using the ``new challenge`` command. @@ -339,7 +344,7 @@ functionalities will be implemented. \subsection{Trap door} -6e388ec78 - A TrapDoor has been added. When crossing a +6e388ec78 - Pacien - A TrapDoor has been added. When crossing a TrapDoor, the Performer clears the Player's previous Rooms Stack. It has been used to link the secret corridor of the off-script map to a trap @@ -350,40 +355,40 @@ own cross() function, which performs the action the clear the Player's Stack. \subsection{Beamer} -6a154d2fe - A Beamer has been added. It can be used once picked +6a154d2fe - Pacien * A Beamer has been added. It can be used once picked up via the ``use'' command. It alternatively memorises the Player's current Room and teleports him back. \subsection{Locked door} -e9c61548b - A locked door has been added in the off-script area. To pass -through, the player needs to have a corresponding Key in his Inventory. +e9c61548b - Pacien - A locked door has been added in the off-script area. To +pass through, the player needs to have a corresponding Key in his Inventory. \subsection{Tests} -The test files were updated to fit the last modifications. +Benoît - The test files were updated to fit the last modifications. \subsection{Transporter room} -c5a766345 - The transporter has been implemented as a sub-type of Door instead -of Room, since the Player has to be transported when he crosses the Door. +c5a766345 - Pacien - The transporter has been implemented as a sub-type of Door +instead of Room, since the Player has to be transported when he crosses the Door. A transporter Room, which is a simple Room that has only TransporterDoor-s, has then been added in the off-script area. \subsubsection{alea} -c99590be11 - An ``alea`` overriding command for the random TransporterDoor was -implemented. It is now possible to force the destination Room with this command. +c99590be11 - Pacien - An ``alea`` overriding command for the random +TransporterDoor was implemented. It is now possible to force the destination Room with this command. \subsection{Character} -3e7f68425 - Characters that can talk have been added. +3e7f68425 - Pacien - Characters that can talk have been added. \subsubsection{Moving character} -Moving characters that can move randomly (WanderingCharacter) or by following -the player's moves (FollowingCharacter) once permitted have been added. +Pacien - Moving characters that can move randomly (WanderingCharacter) or by +following the player's moves (FollowingCharacter) once permitted have been added. The MovingCharacter class contains a method moveAll() which is called each time the player enters a command. @@ -391,20 +396,20 @@ the player enters a command. \section{Zuul even better} -86d6f56dd - A code refactoring was done. +86d6f56dd - Pacien - A code refactoring was done. \subsection{Inheritance} -Inheritance (and interfaces) was already used for Character-s, Door-s, Item-s, -and View-s since the beginning of the project. +Pacien - Inheritance (and interfaces) was already used for Character-s, Door-s, +Item-s, and View-s since the beginning of the project. \subsection{Abstract Command} -The Performer class was replaced by multiple Command sub-types. +Pacien - The Performer class was replaced by multiple Command sub-types. \subsection{Packages} -The code was already organised in packages. +Pacien - The code was already organised in packages. The ``pkg\_'' prefix was NOT used in this project, since it led to inconsistences with other packages. @@ -414,17 +419,17 @@ inconsistences with other packages. \subsection{main} -The main() static method has been already implement in the Main class. +Pacien - The main() static method has been already implement in the Main class. \subsection{jar} -An executable .jar archive containing the Game, the manifest file, and some -resources (pictures and musics) is automatically generated at each modification. +Pacien - An executable .jar archive containing the Game, the manifest file, and +some resources (pictures and musics) is automatically generated at each modification. \subsection{JApplet} -An init() method has been added to the startup Main class and an HTML file -embedding the applet has been created at /applet.html. +Benoît - An init() method has been added to the startup Main class and an HTML +file embedding the applet has been created at /applet.html. Since applets are deprecated, an alternative has been implemented (see \ref{subsec:Better GUI}). @@ -433,32 +438,32 @@ Since applets are deprecated, an alternative has been implemented (see \subsection{Non-droppable items} -ef51d5137 - Non-droppable items were added. +ef51d5137 - Benoît - Non-droppable items were added. \subsection{Hidden doors} -20c9b8b28 - Hidden Doors that are not shown as exits were added and used to -hide the off-script part of the map. +20c9b8b28 - Benoît - Hidden Doors that are not shown as exits were added and +used to hide the off-script part of the map. \subsection{Room sides} -Each Room has been divided into four Side-s that have each an corresponding -image and inventory. This makes the Player look at the elements as the main -character, rather than looking by the top, and makes easier for him to navigate -in the map. +Pacien - Each Room has been divided into four Side-s that have each an +corresponding image (or a dynamically generated placeholder image if not found) and inventory. +This makes the Player look at the elements as the main character, rather than +looking by the top, and makes easier for him to navigate in the map. The ``Turn'' has been also added to enable the Player to turn on himself. \subsection{Quests} -Quests were added to the Game to guide the Player to the predefined goals and to -defines losing and winning situations. +Pacien - Quests were added to the Game to guide the Player to the predefined +goals and to defines losing and winning situations. \subsection{Better GUI} \label{subsec:Better GUI} -As applets were designated as deprecated a long time ago, and because newer -versions of the Oracle Java Runtime Environment are requiring a mandatory code +Pacien - As applets were designated as deprecated a long time ago, and because +newer versions of the Oracle Java Runtime Environment are requiring a mandatory code signing certificate that we can not affors, a new graphical interface using the Google Web Toolkit was implemented. This set of tools enabled translating the game code from Java to JavaScript, @@ -470,23 +475,23 @@ model and required a few changes in the core classes. \subsection{Music} -Background musics corresponding to the current Quest were added, using the new -HTML5