Skip to content

Commit ba39ebb

Browse files
committed
add Game Mode implementation to DG
1 parent ed5c495 commit ba39ebb

4 files changed

Lines changed: 35 additions & 11 deletions

File tree

docs/DeveloperGuide.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ and `DeckParser` for printing the appropriate output when required.
5555

5656
![DG-Design Commands UML](./images-dg/DG-Design-Commands.png?raw=true "Commands UML Class Diagram")
5757

58-
API: [seedu.ecardnomics/command](https://github.com/AY2021S1-CS2113-T14-2/tp/tree/master/src/main/java/seedu/ecardnomics/command)
58+
**API**: [seedu.ecardnomics/command](https://github.com/AY2021S1-CS2113-T14-2/tp/tree/master/src/main/java/seedu
59+
/ecardnomics/command)
5960

60-
Commands are primarily classified into two categories, `NormalCommand` and `DeckCommand`, corresponding to the
61-
application's Normal and Deck Modes, respectively. `NormalCommand` and `DeckCommand` are both abstract children derived
62-
from the overarching abstract class `Command`. The basis `Command` class is defined as such:
61+
Commands are primarily classified into three categories, `NormalCommand`, `DeckCommand`, and `GameCommand`,
62+
corresponding to the application's Normal, Deck, and Game Modes, respectively. All three are abstract children
63+
derived from the overarching abstract class `Command`. The basis `Command` class is defined as such:
6364

6465
```java
6566
public abstract class Command {
@@ -68,11 +69,10 @@ public abstract class Command {
6869
```
6970

7071
It only requires that all derived children implement the `execute()` method. The only two classes not belonging to
71-
either Normal or Deck Mode are `ExitCommand` and `VoidCommand`. The former is so that users can call the command
72-
`exit` from anywhere in the application, while the latter is a catch-all "command" for all erroneous commands a
73-
user enters.
72+
individual modes are `ExitCommand` and `VoidCommand`. The former is so that users can call the command `exit` from
73+
anywhere in the application, while the latter is a catch-all "command" for all erroneous commands a user enters.
7474

75-
`NormalParser` and `DeckParser` play important roles in execution of specific commands, e.g. `CreateCommand`, because
75+
The `Parser` classes play important roles in execution of specific commands, e.g. `CreateCommand`, because
7676
they define methods that check and ensure the conformity of user input to the commands' expected input. Below is a
7777
sequence diagram showcasing this interaction, for execution of a `CreateCommand`, e.g. `create
7878
microeconomics`:
@@ -103,8 +103,6 @@ components.
103103

104104
### Storage
105105

106-
## Implementation - Basic
107-
108106
## Implementation - Features
109107

110108
### Save to PPT (Kai Jie)
@@ -115,9 +113,35 @@ components.
115113

116114
### Saving to text file (Wayne)
117115

118-
### Game Mode (Zhixiang)
116+
### Game Mode
117+
118+
eCardnomics' quintessential mode. cGame Mode can be started from either Normal Mode or Deck Mode. The `start` command
119+
is parsed by `NormalParser` (see [Commands](#commands)).
120+
121+
Game Mode contains two main components: a storage component, `GameStorage`, and a logic component, `GameEngine`. The
122+
former handles all data structures used by Game Mode, and stores the original deck (`originalDeck`), question pool
123+
(`deque`), and retest question pool (`retestStore`). The latter executes the main game loop (`runGameLoop()`), and
124+
interacts with `GameStorage` on package-private basis; i.e., `GameEngine` and `GameStorage` have full mutual
125+
access as if they were a single class. This is one of the main intentional design decisions.
126+
127+
![DG-Implementation-Features-Game-Mode-Architecture](./images-dg/Game-Mode-Design.png?raw=true "Game Mode
128+
Architecture Diagram")
129+
130+
**See also**: [Gameplay description](./UserGuide.md#gameplay)
131+
132+
The actual "game" aspect of eCardnomics is essentially summarised in the `runGameLoop()` high-level overview above
133+
. For a textual gameplay description, check out the "See also" link.
134+
135+
The following elaborates the execution flow of Game Mode, from after a `start` command has been parsed in Normal Mode:
136+
137+
![DG-Implementation-Features-Game-Mode-Sequence](./images-dg/Game-Mode-Sequence.png?raw=true "Game Mode UML Sequence
138+
Diagram"
139+
140+
**API**: [seedu/ecardnomics/game](https://github.com/AY2021S1-CS2113-T14-2/tp/tree/master/src/main/java/seedu
141+
/ecardnomics/game)
119142

120143
## Product scope
144+
121145
### Target user profile
122146

123147
{Describe the target user profile}
71.8 KB
Loading
268 KB
Loading
283 KB
Loading

0 commit comments

Comments
 (0)