forked from nus-cs2113-AY2122S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from ngoivanessa/v2.0
update DG
- Loading branch information
Showing
9 changed files
with
175 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
!include style.puml | ||
|
||
|
||
Participant "<<class>> Parser" as parser PARSER_COLOUR | ||
Participant ":AddCommand" as add COMMAND_COLOUR | ||
Participant ":IngredientList" as ingredient_list INGREDIENTLIST_COLOUR | ||
Participant ":IngredientGroup" as ingredient_group INGREDIENTGROUP_COLOUR | ||
Participant ":Ingredient" as ingredientClass INGREDIENT_COLOUR | ||
Participant ":Storage" as storage STORAGE_COLOUR | ||
|
||
|
||
-> parser: parse ("add a/carrot n/200 e/ 25/12/2021") | ||
activate parser PARSER_COLOUR | ||
|
||
parser -> parser : parseAddCommand("a/carrot n/200 e/ 25/12/2021") | ||
activate parser PARSER_COLOUR | ||
|
||
parser -> add **: AddCommand(ingredient) | ||
activate add COMMAND_COLOUR | ||
return | ||
|
||
parser -> add : run() | ||
activate add COMMAND_COLOUR | ||
|
||
add -> ingredient_list : getInstance() | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
return instance | ||
|
||
add -> ingredient_list : add(ingredient) | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
|
||
ingredient_list -> ingredientClass : getName() | ||
activate ingredientClass INGREDIENT_COLOUR | ||
return ingredientName | ||
|
||
ingredient_list -> ingredient_list : isIngredientInList(ingredientName) | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
return isRepeatedName | ||
|
||
alt !isRepeatedName | ||
ingredient_list -> ingredient_group **: IngredientGroup() | ||
activate ingredient_group INGREDIENTGROUP_COLOUR | ||
return newIngredientGroup | ||
|
||
ingredient_list -> ingredient_list : add(newIngredientGroup) | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
return | ||
|
||
ingredient_list -> ingredient_group : setIngredientGroupName(ingredientName) | ||
activate ingredient_group INGREDIENTGROUP_COLOUR | ||
return | ||
|
||
ingredient_list -> ingredient_group : add (ingredient) | ||
activate ingredient_group INGREDIENTGROUP_COLOUR | ||
return | ||
|
||
|
||
else isRepeatedName | ||
ingredient_list -> ingredient_list : findIngredientIndexInList(ingredientName) | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
return ingredientIndex | ||
|
||
ingredient_list -> ingredient_list : get(ingredientIndex) | ||
activate ingredient_list INGREDIENTLIST_COLOUR | ||
return | ||
ingredient_list -> ingredient_group : add(ingredient) | ||
activate ingredient_group INGREDIENTGROUP_COLOUR | ||
return | ||
end | ||
|
||
ingredient_list -> storage : writeIngredientsToMemory(ingredientList) | ||
activate storage STORAGE_COLOUR | ||
return | ||
|
||
return | ||
|
||
return resultMsg | ||
return resultMsg | ||
return CLI message | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters