You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Model` component is responsible for storing and managing data. It achieves this by maintaining a runtime model of
155
+
the data using Java objects that represent real-world entities and associations that simulate relationships between these entities.
156
+
157
+
**Functionality** :
158
+
159
+
* The `UI` uses the data inside the `Model` to display to the user.
160
+
* The `Storage`uses the data inside the `Model` to store it on the local hard-disk.
161
+
* Does not depend on any of the other three components, as it represents data entities of the domain, which should make sense on their own without depending on other components
* The Model manages a `FriendsList`, which is made up of a `UniqueFriendsList`, which contains an `ObservableList<Friend>`.
190
+
* This `ObservableList<Friend>` is wrapped inside a `FilteredList<Friend>`. This is to enable easy filtering of the friends list for commands like `--list` and `recommend`.
191
+
* This `FilteredList<Friend>` is wrapped inside a `SortedList<Friend>`. This is to enable easy sorting of the friends list for commands like `recommend`.
192
+
* The `ObservableList<Friend>` is exposed to the `UI` component and is displayed under the 'Friends' section of the User interface.
* stores the currently 'selected' `Friend` objects (e.g., results of a `list` query) as a separate _filtered_ list which is not exposed to outsiders.
171
-
* stores the currently 'selected' and 'sorted' `Friend` objects (e.g., results of a `recommend` query) as a separate _filteredAndSorted_ list which is exposed to outsiders as an unmodifiable `ObservableList<Friend>` that can be 'observed' <br>e.g. the UI's `Friends` Window is bound to this list so that the UI automatically updates when the data in the list changes.
172
-
* stores the currently 'selected' `Game` objects (e.g., results of a 'list' query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList<Game>` that can be 'observed' <br>e.g. the UI's `Games` Window is bound to this list so that the UI automatically updates when the data in the list changes.
173
-
* stores a `UserPref` object that represents the user’s preferences. This is exposed to the outside as a `ReadOnlyUserPref` object.
174
-
* does not depend on any of the other three components (as the `Model` represents data entities of the domain, they should make sense on their own without depending on other components)
196
+
Games:
197
+
* The Model manages a `GamesList`, which is made up of a `UniqueGamesList`, which contains an `ObservableList<Game>`.
198
+
* This `ObservableList<Game>` is wrapped inside a `FilteredList<Games>`. This is to enable easy filtering of the games list for commands like `--list`.
199
+
* The `ObservableList<Game>` is exposed to the `UI` component and is displayed under the 'Games' section of the user interface.
175
200
176
201
### 3.5 Storage component
177
202
@@ -447,12 +472,15 @@ such as `ModelManager#updateFilteredAndSortedFriendsList(Predicate, Comparator)`
447
472
448
473
### 4.6 Get Feature
449
474
450
-
#### 4.6.1 Implementation
475
+
#### 4.6.1 Description
476
+
477
+
The `--get` command is used to get/obtain the complete information about a Friend or Game.
478
+
479
+
#### 4.6.2 Implementation
451
480
452
481
When called by the `MainWindow#executeCommand`, the `LogicManager#execute` method proceeds to call the `MainParser#parseCommand` method, which returns a `Command` object based on the workflow shown in the activity diagram below.
<br><center><ins>Image: Sequence diagram showing the interaction between various entities<br>of 'Logic' and 'Model' component during the execution of a 'friend --get FRIEND_ID' command.</ins></center>
484
511
485
512
`GetGameCommand` is executed similarly, but it deals with games and game lists.
486
513
487
-
#### 4.6.2 Design Considerations
488
-
489
514
Once a `CommandResult` is created with the correct `Friend` or `Game`, its passed on to the `Ui`, which then in turn takes care of filtering and displaying the right information of the object in focus.
490
515
*`CommandResult` with a `Friend` object
491
516
*`Ui` creates a `FriendMainCard` that displays all the information of a friend like the `FriendId`, `Name`, `Schedule` and all the `GameFriendLink`s held in the `Friend` object.
@@ -536,28 +561,30 @@ for future multiplayer competitive gaming sessions.
536
561
537
562
### 6.2 User stories
538
563
539
-
Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`
564
+
Priorities: High (must have) - `* * *`, Medium (useful to have) - `* *`, Low (nice to have) - `*`
540
565
541
566
| Priority | As a (describes user) | I want to be able to (functionality) | So that I can (rationale) |
0 commit comments