-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113-T11-4] EconoCraft Pro #30
base: master
Are you sure you want to change the base?
Changes from 151 commits
9978e26
32e3d55
41b181e
9361641
669f19b
1c0ef72
814b743
95d44e9
df423e6
0c455e8
978aacf
9b4132f
13b1af9
54ca280
d6d6da2
32ab5f6
27a9d6a
37c9250
02b45c3
8ea2464
6b80e1a
090f8fc
73a5c82
70a0add
17cfd2f
8f8fcb5
a4d75ae
7aa15d0
b03f022
7d71b15
d15dcba
406dfe6
dde5ee0
682a16b
8dc30d0
ffc3fca
e2a229e
7625176
1ed3b10
d4a9ab4
939572a
fca7baf
e006a81
545894b
3928098
d764622
e5f65d5
c3f35ff
8d9b889
17b3d56
1310d5c
103fd45
9dd00f6
db59c7e
4a62ed7
981398e
e2c9e00
c4c6e65
1954ae0
0d95526
c6e27aa
25943fc
b289879
4c1163b
3624fb5
b39a331
302b0e1
fb5335a
57a2f28
c548f0c
c50405c
61fe9a5
c60abdf
6605981
584d441
e771bb7
8bc2fb4
6d5afd2
177b38f
cf5361e
ecfe96c
01cce9c
2b01d76
773e81c
3d3426a
40a3f3c
aafcf47
86d8b16
107c157
d05386a
6e05a97
b864d78
596caf5
f5c1224
1515929
2b9de88
1c10d39
099158f
ebed36f
86fcc8a
0d634e8
5199d70
af44dae
7863ff8
a6f6a49
2a69724
b306170
4d670de
21f8a16
645a427
ba57f81
c033a7e
f8ac266
41434a9
d14fe30
14cc48f
ac434f8
28f4882
44abbcc
de56f4f
e109792
536f72d
d0a593e
883f994
85f72ca
4eb0ea2
0af84ee
d401d24
bc53e88
3826b30
6077e03
f416597
ef7e309
6611a0f
86a1110
2f99bc4
d4570d6
9ec069f
b5c7caf
e33351d
f0288ca
02013d9
50173d3
d740236
f934363
312bf19
3030917
a705c69
b3914dc
dbb9a39
61333c0
120ce5a
963a3e8
ff1ef46
c1951f5
018052c
2389bd7
b579a9f
04ca709
a90a300
b17b124
0dffebd
e1939c0
b506bfd
54ec5bf
1995374
018e752
6f09514
c058f56
f08028b
9f96112
bd75459
0de1b00
67ed41c
4587c64
2bffb59
1cb3080
361be83
733c0c7
86fc0b7
49e0267
4690ff2
709b3c5
02372f8
a348286
aed676f
80282b8
3003345
693a5a0
d3ce434
cfc3001
0a0b586
3c5de37
e87de7b
24b1f64
9de90d7
98a7f37
1cfbce9
2abc214
ac321fa
b32c548
58d1e30
c35eb0b
1c92f1b
609f269
8047352
a3dd7d7
c40ce0e
509e0ca
f9ce641
14586b2
52373dc
398eea5
e1ff09a
b441a69
d413a81
4885446
ece0209
b425ded
f4d79b0
100a14a
c763b96
1688b23
d53b0a3
e3d2760
5dd81ff
1e1c379
4d0f367
b7b603d
04e324d
abab326
701dedb
b4d3de2
61b2b86
95b54ca
d646342
913bc6c
44f9079
b583005
da16157
d714266
cb89726
c003020
292be8f
8f10cdc
636de3c
d9979a5
c4b7327
fa2ede0
48a8b30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
|
||
META-INF/ | ||
docs/UML diagram/Script/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,8 @@ checkstyle { | |
|
||
run{ | ||
standardInput = System.in | ||
enableAssertions(true) | ||
} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
| Display | Name | Github Profile | Portfolio | | ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|:-----------:|:---------------------------------------------------------:|:-------------------------------------------:| | ||
| ![](https://image.umall.com.au/image/goods4/6921294355383/image/1.jpg?x-oss-process=image/resize,w_750/sharpen,100/quality,Q_100) | Xia Cong | [Github CXIA17](https://github.com/CXIA17) | [Portfolio](docs/team/johndoe.md) | | ||
| ![](https://th.bing.com/th/id/OIP.sDaKNkXjaMY7lIZBnMkYsQHaFj?w=231&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7) | MA JIAJUN | [Github](https://github.com/Jamarcus111) | [Portfolio](https://www.linkedin.com/feed/) | | ||
| ![](https://wingfungdundee.co.uk/WebRoot/Store25/Shops/619556e1-1fbf-4030-bcf6-c7e2e8a4f752/620E/4594/146C/E2B0/E561/0A48/3522/3482/CKA101B.jpg) | Li Kunjun | [Github](https://github.com/StargazerX0?tab=repositories) | [Portfolio](docs/team/LiKunjun.md) | | ||
| ![](https://miro.medium.com/v2/resize:fit:1358/0*hJtj0p-31PmVA4wd.jpeg) | Zhu Minghui | [Github](https://github.com/ZMinghuiZ) | [Portfolio](docs/team/johndoe.md) | | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DG is neatly arranged with concise explanation, helps with its readability! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,211 @@ | ||
# Developer Guide | ||
|
||
## Table of Contents | ||
|
||
* [Design](#design) | ||
* [Architecture](#architecture) | ||
* [Main components](#main-components) | ||
* [Component interaction](#component-interaction) | ||
* [UI components](#ui-components) | ||
* [EconoCraftLogic components](#econocraftlogic-components) | ||
* [MiniGame components](#miniGame-components) | ||
* [Implementation](#implementation) | ||
* [MiniGame - Typing Game](#miniGame---typing-Game) | ||
* [MiniGame - Tic Tac Toe](#miniGame---tic-tac-toe) | ||
* [MiniGame - True or False](#miniGame---true-or-false) | ||
* [Product scope](#product-scope) | ||
* [Target user playerProfile](#target-user-playerprofile) | ||
* [Value proposition](#value-proposition) | ||
* [User Stories](#user-stories) | ||
* [Non-Functional Requirements](#non-functional-requirements) | ||
* [Glossary](#glossary) | ||
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
|
||
## Design & implementation | ||
## Design | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Format of DG is neat, well-formatted, easy to understand and consistent. Well Done! |
||
### Architecture | ||
|
||
![Architecture.png](UML%20diagram%2FArchitecture.png) | ||
|
||
The **Architecture diagram** above showcases the high-level design of the EconoCraft Pro application. | ||
|
||
The following section would give a brief overview of the different components of the application and their interactions | ||
with each other. | ||
|
||
#### Main components: | ||
|
||
`Main` (consisting of class `EconoCraft` and `EconoCraftLogic`) | ||
is in charge of the game initialization and starting the main game loop. | ||
|
||
* At game initialization, it reads the necessary information from prompted user input and develops the player profile. | ||
* When game starts, it initializes the game logic and starts the main game loop. | ||
|
||
The functionality of the game is divided into different components, each responsible for a different aspect of the game. | ||
|
||
* `PlayerProfile`: Represents the player's profile and is responsible for storing and updating the player's information. | ||
* `Parser`: Responsible for parsing the user input. | ||
* `ResponseManager`: Responsible for generating the response to the user input. | ||
* `EconoCraftLogic`: Responsible for executing user command and updating the game state. | ||
* `MiniGame`: Responsible for handling the mini-games that the player can play to gain rewards. | ||
* `CommandFactory`: Responsible for using the parsed user input to produce executable commands. | ||
|
||
#### Component interaction: | ||
|
||
The *Sequence Diagram* below showcases the interaction between the different components of the EconoCraft Pro | ||
application when a user inputs a command `work`. | ||
|
||
For `CommandFactory` and `Minigame`, | ||
* Each defines its API for creating commands and mini-games respectively, where | ||
`Command` is the API for `CommandFactory` and `MiniGame` is the API for `MiniGame`. | ||
* Implements its functionality with concrete classes such as `WorkCommand` and `TypingGame`. | ||
|
||
The sections below would give more details of each component. | ||
|
||
## UI components | ||
|
||
UI consists of the following components: | ||
* `Parser` | ||
* `ResponseManager` | ||
* `CommandType` | ||
|
||
![UI.png](UML%20diagram%2FUI.png) | ||
|
||
The **UI components**, | ||
* `Parser` parses the user input for `CommandFactory` to produce `Command` | ||
* `ResponseManager` generate the response to the user according to the *command execution* and *game logic*. | ||
|
||
## EconoCraftLogic components | ||
|
||
Here is the partial class diagram of the `EconoCraftLogic` component: | ||
|
||
![Logic.png](UML%20diagram%2FLogic.png) | ||
|
||
> [!NOTE] | ||
> - The `XYZ` in `XYZCommand` represents the exact command e.g., `WorkCommand`, `RestCommand`, `ExerciseCommand`. | ||
> - The `XYZ` in `XYZMiniGame` represents the exact mini-game e.g., `TypingGame`, `TicTacToe`, etc. | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
Here is the sequence diagram of the `EconoCraftLogic` executing the command: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sequence diagram following could also benefit from UML notes to help viewers understand instead of just bullet points after the diagram. |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Notation seems to be compliant with the notation covered in the course. |
||
![Work.png](UML%20diagram%2FWork.png) | ||
|
||
The `EconoCraftLogic` mechanism: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In some of your diagrams, such as in EconoCraftLogic components, the standard model of excluding icons is not followed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, may I ask what does it mean by excluding icons? |
||
1. `EconoCraftLogic` receives the user input string and pass it into `CommandFactory`. | ||
2. `CommandFactory` would use `Parser` to parse the user input string and produce a `Command`. | ||
3. `EconoCraftLogic` would execute the `Command` which will: | ||
* update the player profile accordingly. | ||
* use `ResponseManager` to generate the response to the user. | ||
|
||
## MiniGame components | ||
|
||
Here is the partial class diagram of the `MiniGame` component: | ||
|
||
![MiniGame.png](UML%20diagram%2FMiniGame.png) | ||
|
||
The `MiniGame` mechanism: | ||
1. For command `work`, `rest`, and `exercise`, they would have their respective mini-games. | ||
2. When these commands are generated and executed in `EconoCraftLogic`, the respective mini-game would be played. | ||
3. The command would then update the player profile according to the mini-game result. | ||
|
||
# Implementation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good thorough explanation on the implementation process but would it better if there were also example inputs/output usages as well |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be enough examples e.g., sample inputs/outputs. i can understand. |
||
## MiniGame - Typing Game | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The different functionalities of the different mini-games is comprehensively but sensibly written about in the DG. Good job. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Will take note of the issues:) |
||
|
||
The implementation of the Typing Game is as follows: | ||
|
||
1. The game can be invoked by the `WorkCommand` class when the user inputs the `work` command. | ||
2. It makes use of the `ResponseManager` to generate the instructions of the game to the user. | ||
3. The user would be prompted to type the given text as fast as they can. | ||
4. This game made use of the `CompletableFuture` class to create separate thread which handles the countdown timer and user input at the same time. | ||
5. When the user finishes typing or the time limit is reached, the game would calculate the user's typing speed and accuracy and reward the user accordingly. | ||
6. Finally, the `WorkCommand` would update the player profile with the reward earned according to the user's performance in the game. | ||
|
||
## MiniGame - Tic Tac Toe | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps some diagrams to represent the architectures of the mini games would be nice. |
||
The implementation of the Tic Tac Toe Game is as follows: | ||
|
||
1. The game can be invoked by the `ExerciseCommand` class when the user inputs the `exercise` command. | ||
2. It makes use of the `ResponseManager` for instructions and display the board status. | ||
3. The user would be prompted to choose player mark and place it when entering the game. | ||
4. AI player will randomly choose available to place mark once user places the mark. | ||
5. After each placement, the game would check the status to determine whether continue the game or not. | ||
6. If the board is full or there are three consecutive marks, the game will announce the winner or say "it's a draw". | ||
7. Finally, the `ExerciseCommand` would update the player profile with the reward or punishment for health. | ||
|
||
## MiniGame - True or False | ||
|
||
1. The game can be invoked by the `RestCommand` class when the user inputs the `rest` command. | ||
2. It makes use of the `ResponseManager` for instructions and display the questions to answer. | ||
3. The user would be prompted to answer True or False by typing `T` or `F`. | ||
4. When the user returns his/her answer, the `ResponseManager` will display the correctness of the response. | ||
5. When the user finishes answering all the questions, `ResponseManager` will output how many questions the user answers correctly. | ||
6. Finally, the `RestCommand` would update the player profile with the reward or punishment earned according to the game. | ||
|
||
## Investment game - Stock | ||
|
||
1. The process of buying stock can be invoked by the `StockCommand` class when user inputs `stock`. | ||
2. It makes use of `ResponseManager` for instructions and output the stock graph and information relating to the stock. | ||
3. The user would be prompted to input the number of stocks they would like to purchase in integer. | ||
4. `ResponseManager` will indicate the completion of purchase after user's input. | ||
5. When the user finishes the purchase, stock they bought will be stored inside `Asset` class. | ||
6. Input `status` will output the stock the user currently possesses. | ||
7. The process of selling stock can be invoked by the `SellStockCommand` class when user input `sellstock`. | ||
8. The system will calculate user's profit gained at the current price of the stock and return the money back to the | ||
user based on the stock's current price. | ||
9. User can keep the stock they purchased inside their asset for as long as they want. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe consider adding a diagram of what a stock represents, as it has felt quite arbitrary throughout the entire guide. |
||
|
||
## Product scope | ||
### Target user profile | ||
### Target user playerProfile | ||
|
||
{Describe the target user profile} | ||
{Describe the target user playerProfile} | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
|
||
## User Stories | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very detailed and fits the scope of the project with regards to the user stories. Good work! |
||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||
| Version | As a ... | I want to ... | So that I can ... | | ||
|---------|------------------|----------------------------------------------------------------|-------------------------------------------------------------| | ||
| v1.0 | new user | see usage instructions | refer to them when I forget how to use the application | | ||
| v1.0 | user | view basic command list and game flow | navigate and start the game smoothly | | ||
| v1.0 | user | add my name to the programme | have a personalised game interaction | | ||
| v1.0 | user | exit from the programme | decide when to exit based on my own preferrence | | ||
| v1.0 | user | view my player or company status | know how much assets that I have | | ||
| v2.0 | user | find a to-do item by name | locate a to-do without having to go through the entire list | | ||
| v2.0 | user | restart the game | reset the progess when a bad decision is made | | ||
| v2.0 | user | check current game progress via a progress percentage bar | be clear about how many more task needs to be done to complete the game | | ||
| v2.0 | user | set finantial task to be completed | complete task to increase game progress | | ||
| v2.0 | user | track my in-game money flow | play the game more strategically | | ||
| v2.0 | first-time user | view tips for playing the game | familiarise with the game faster | | ||
| v2.0 | first-time user | view the background story of the game | have a better understanding on what the game is about | | ||
| v2.0 | experienced user | perform employee hiring action | develop the virtual startup | | ||
| v2.0 | user | invest in virtual stock market | increase the earning for company development | | ||
| v2.0 | user | delete a task that has been created | start over with a new idea or approach | | ||
| v2.0 | user | have a reward system for completing each task | feel a sense of achievement when complete the task | | ||
| v2.0 | player | task with different challenge when entered command | feel more engaged to the game | | ||
| v2.0 | user | want to have random event at the end of each round | enjoy the uncertainty within the gameplay process | | ||
| v2.0 | user | save my personal profile | not to lose any progress when I play again | | ||
| v2.0 | user | see different game ending from different decision made in game | gain a sense of satisfaction when good ending happens | | ||
| v2.0 | user | have 3-4 saved progresses | choose the progress based on my preference | | ||
| v2.0 | user | name each progress | differentiate saved progresses | | ||
| v2.0 | user | delete saved progresses | delete the saved data when the data has no use | | ||
| v2.0 | advanced player | modify the saved file | adjust my game infomation when possible | | ||
| v2.0 | user | choose level of difficulties of the game | adjust the difficulties based on my skills | | ||
| v2.0 | user | learn different player skills | complete mission and task easier | | ||
| v2.0 | user | have lucky draw to gain interesting rewards | feel the excitement and joy of the game | | ||
| v2.0 | user | get loan from the virtual bank | use for the investment and expand the businesses | | ||
| v2.0 | user | negotiate with game NPCs | feel more engaged to the game | | ||
| v2.0 | busy-user | save the game data into local | continue the saved progress next time | | ||
| v2.0 | first-time user | see what actions I can do in different player level | type correct command to complete the tasks | | ||
| v2.0 | user | trigger random event | feel more insterested to the game | | ||
|
||
|
||
|
||
|
||
## Non-Functional Requirements | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you could standardise the software/theme being used for all sequence diagrams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size of your text and colors is great!