aboutsummaryrefslogtreecommitdiff
path: root/report/progression.tex
diff options
context:
space:
mode:
Diffstat (limited to 'report/progression.tex')
-rw-r--r--report/progression.tex290
1 files changed, 165 insertions, 125 deletions
diff --git a/report/progression.tex b/report/progression.tex
index 0108d2d..cca0477 100644
--- a/report/progression.tex
+++ b/report/progression.tex
@@ -1,82 +1,72 @@
1\chapter{Work progression} 1\chapter{Work progression}
2 2
3\section{Zuul bad}
4
5
6
7
8
9\section{Zuul better v1} 3\section{Zuul better v1}
10 4
11\subsection{printLocationInfo} 5\subsection{printLocationInfo}
12 6
13This code duplication has been previously avoided with the printRoomInfo() 7e52a34789 - This code duplication has been previously avoided with the
14method. 8printRoomInfo() method.
15It has been renamed to printLocationInfo(), as part of the commit e52a34789, to 9It has been renamed to printLocationInfo() to match the exercise.
16match the exercise.
17 10
18\subsection{getExit} 11\subsection{getExit}
19 12
20The exit attributes have been made private and a getter was added in commit 1353c427ff3 - The exit attributes have been made private and a getter has been
2153c427ff3. A switch statement has been used instead of multiple if statements. 14added.
15A switch statement has been used instead of multiple if statements.
22 16
23\subsection{getExitString} 17\subsection{getExitString}
24 18
25This method has been added as part of commit ca65af2e2. 19ca65af2e2 - This method, which returns a String containing the informations
20about the Room's exits, has been added.
26 21
27\subsection{HashMap, setExit} 22\subsection{HashMap, setExit}
28 23
29Room exits are now stored in an HashMap since commit c9d890b9b. The setExits() 24c9d890b9b - Room exits are now stored in an HashMap. The setExits() method has
30method has been replaced by setExit() which takes advantages of the HashMap. 25been replaced by setExit() which takes advantages of the HashMap.
31 26
32\subsection{Vertical direction} 27\subsection{Vertical direction}
33 28
34In commit 4145a5e8c, the getExitString() method has been modified to be able to 294145a5e8c - The getExitString() method has been modified to be able to
35print the availability of the new exits, used in the stairwell at wing 3. Due 30print the availability of the new exits, used in the stairwell at wing 3. Due
36to the architecture of these rooms, the side exits that were previously settled 31to the architecture of these rooms, the side exits that were previously settled
37to link them have been kept. 32to link them have been kept.
38 33
39\subsection{keySet ?} 34\subsection{keySet ?}
40 35
41The keySet() method of the class HashMap returns a Set of the keys contained in 36The keySet() method of the class HashMap returns a Set of the keys
42the map. 37associated to values stored in the Map.
43 38
44\subsection{getExitString ?} 39\subsection{getExitString ?}
45 40
46The getExitString() method returns a String listing the room's exits. 41The getExitString() method returns a String listing the Room's exits.
47To achieve that, it iterates through the exits Map's keys, that is a Set of 42To achieve that, it iterates through the exits Map's keys, which is a Set of
48Strings, appending each one to the String that it returns. 43String-s, appending each one to the String that it returns.
49 44
50\subsection{getLongDescription} 45\subsection{getLongDescription}
51 46
52The Room class now uses the previously explained getExitString() method and 47e510b08d0 - The Room class now uses the previously explained getExitString()
53includes the getLongDescription() method that returns the full description of 48method and includes the getLongDescription() method that returns the full description of
54the room since commit e510b08d0. 49the room.
55
56\subsection{Object diagram}
57
58%TODO
59
60\subsubsection{Changes on execution}
61 50
62%TODO
63 51
64\section{Zuul with features} 52\section{Zuul with features}
65 53
66\subsection{look} 54\subsection{look}
67 55
68The look command has been added with the commit 698e3cd25. 56698e3cd25 - The look command, which prints informations about the current Room,
57has been added.
69 58
70\subsection{eat} 59\subsection{eat}
71 60
72The eat command has been added with the commit 40b9b4816. 6140b9b4816 - The eat command, that just prints a special message, has been added.
73 62This command has then been deleted later in the development since it was
63useless in the scenario.
74 64
75\section{Zuul better v2} 65\section{Zuul better v2}
76 66
77\subsection{showAll, showCommands} 67\subsection{showAll, showCommands}
78 68
79This modifications are part of the commit 79d33230b. 6979d33230b - Theses methods have been implemented.
80 70
81\subsection{Adding commands} 71\subsection{Adding commands}
82 72
@@ -86,50 +76,49 @@ the Game class and its processCommand() method.
86 76
87\subsection{getCommandList} 77\subsection{getCommandList}
88 78
89The command list is not printed in the CommandWords class anymore. Instead, this 795f1d0ada2 - The command list is not printed in the CommandWords class anymore.
90class returns a String, forwarded by the Parser class, that is then printed in 80Instead, this class returns a String, forwarded by the Parser class, that is
91the Game class, thanks to commit 5f1d0ada2. 81then printed in the Game class.
92 82
93\subsection{Comparison with reference} 83\subsection{Comparison with reference}
94 84
95The printLocationInfo() method, used only twice, has been trimmed by the commit 85590a932e5 - The printLocationInfo() method, used only twice, has been trimmed
96590a932e5 and has been replaced by a call to the getLongDescription() method of 86and has been replaced by a call to the getLongDescription() method of the Room
97the Room class. 87class.
98 88
99A missing getter for the Room description has been added as part of the commit 89f84606424 - A missing getter for the Room description has been added.
100f84606424.
101 90
102The loop building the command list String has been modified to use an Iterator 910c5793abf - The loop building the command list String has been modified to use
103with the commit 0c5793abf. 92an Iterator.
104 93
105\subsection{StringBuilder} 94\subsection{StringBuilder}
106 95
107The command list and the exit list are now created using a StringBuilder since 96ee5ec33aa - The command list and the exit list are now created using a
108commit ee5ec33aa. This avoids the creation of a new String object at each 97StringBuilder. This avoids the creation of a new String object at each
109concatenation, and thus allows better performances. 98concatenation, and thus allows better performances.
110 99
111\subsection{Room objects} 100\subsection{Room objects}
112 101
113Rooms are now stored in an HashMap since commit f64f1ffb0, so they can be 102f64f1ffb0 - Rooms are now stored in an HashMap, so they can be passed to any
114passed to any method in any class. 103method in any class.
115 104
116\section{Zuul with images} 105\section{Zuul with images}
117 106
118\subsection{Game, GameEngine, UserInterface} 107\subsection{Game, GameEngine, UserInterface}
119 108
120The following methods was implemented as part of commit 54e102463. 10954e102463 - The methods have been implemented.
121 110
122\subsubsection{Game} 111\subsubsection{Game}
123 112
124The constructor of this class instantiates the GameEngine and the UserInterface, 113The constructor of this class instantiates the GameEngine and the UserInterface,
125and set the output of the first to the second. 114and sets the output of the first to the second.
126 115
127\subsubsection{GameEngine} 116\subsubsection{GameEngine}
128 117
129This class contains the attributes and methods previously contained in the Game 118This class contains the attributes and methods previously contained in the Game
130class. 119class.
131 120
132Instead of printing to the standard console output, it prints to the GUI. 121Instead of printing to the standard console output, it prints to the Swing GUI.
133 122
134\subsubsection{UserInterface} 123\subsubsection{UserInterface}
135 124
@@ -140,7 +129,9 @@ interact with them.
140\subsection{Parser/Scanner} 129\subsection{Parser/Scanner}
141 130
142Since commands are entered through a text field instead of the console, the 131Since commands are entered through a text field instead of the console, the
143use of Scanner that read from the standard system input is not required anymore. 132use of Scanner that read from the standard system input is not required for the
133Swing GUI.
134
144 135
145\subsection{addActionListener() and actionPerformed()} 136\subsection{addActionListener() and actionPerformed()}
146 137
@@ -153,10 +144,10 @@ event that happened.
153 144
154\subsection{Add a button} 145\subsection{Add a button}
155 146
156A help button was added with commit 7f153a4c1. The processCommand() method was 1477f153a4c1 - A help button has been added. The processCommand() method has been
157modified to take the command String as parameter instead of reading it only from 148modified to take the command String as a parameter instead of reading it only
158the text field, and the actionPerformed() method was modified accordingly to 149from the text field, and the actionPerformed() method has been modified
159forward the command. 150accordingly to forward the command.
160 151
161 152
162\section{Zuul MVC} 153\section{Zuul MVC}
@@ -178,15 +169,21 @@ program, which are the GameEngine, the Interpret, the Parser and the Performer.
178They handle the events created by the user's actions and modify the Game model 169They handle the events created by the user's actions and modify the Game model
179accordingly, refreshing the view to display the new game state. 170accordingly, refreshing the view to display the new game state.
180 171
181Several internal modifications in the existing classes were made in order to 172bd639caa0 - Several internal modifications in the existing classes were made in
182separate the logic from the data storage as part of commit bd639caa0. 173order to separate the logic from the data storage.