Skip to content

Commit

Permalink
Merge pull request #95 from tannerlie/branch-update-developer-guide
Browse files Browse the repository at this point in the history
Update user guide
  • Loading branch information
tannerlie committed Apr 8, 2024
2 parents 8b358f1 + 837cc8d commit b91e250
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 deletions.
26 changes: 26 additions & 0 deletions graph/Architecture.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
box Architecture
participant "User" as user
participant "CalculaChroniclesOfTheAlgorithmicKingdom" as main
participant ":UI" as ui
participant ":Parser" as parser
participant ":MoveRightCommand" as command

user -> main : "w"
activate main
main -> parser : parseCommand()
activate parser
parser --> main : command
deactivate parser
main -> command : execute()
activate command
command --> main
deactivate command
main -> ui : print()
activate ui
ui --> user
deactivate ui
user -> main : next command

end box
@enduml
78 changes: 78 additions & 0 deletions graph/ItemUsage.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@startuml
box
participant ":CalculaChroniclesOfTheAlgorithmicKingdom" as main
participant ":UseCommand" as use
participant ":TextBox" as text
participant ":PlayerStatus" as status
participant ":BaseMap" as map
participant ":PlayerInventory" as inventory

activate main
main -> use : execute()
activate use
opt current screen displayed is consumable inventory screen
use -> text : setNextInstruction(instruction)
activate text
text --> use
deactivate text
use -> text : setNextError(error)
activate text
text --> use
deactivate text
use --> main
end
opt consumable list is empty
use -> text : setNextError(error)
activate text
text --> use
deactivate text
use --> main
end
opt item not specified
use -> text : setNextError(error)
activate text
text --> use
deactivate text
use --> main
end
opt item name was provided
use -> use : findItem(itemString)
activate use
use -> status : getPlayerInventory()
activate status

status --> use : inventory
deactivate status
alt item is in list
use -> inventory : useItem(item)
activate inventory
inventory --> use
deactivate inventory
else
use -> text : setNextError(error)
activate text
text --> use
deactivate text
deactivate use
end
use --> main
end
use -> status : getPlayerInventory()
activate status
status --> use
deactivate status
opt item index doesn't exist
use -> text : setNextError(error)
activate text
text --> use
deactivate text
use --> main
end
use -> inventory : useItem(item)
activate inventory
inventory --> use
deactivate inventory
use --> main
deactivate use
end box
@enduml
16 changes: 16 additions & 0 deletions graph/OpenInventory.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@startuml
box
participant ":CalculaChroniclesOfTheAlgorithmicKingdom" as main
participant ":OpenInventoryCommand" as open
participant ":BaseMap" as map

activate main
main -> open : "execute()"
activate open
open -> map : "get(INVENTORY_IDENTITY)"
activate map
map --> open : inventory
deactivate map
open --> main
end box
@enduml
Binary file added picture/ArchitectureSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added picture/ItemUsage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added picture/OpenInventory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b91e250

Please sign in to comment.