Closed PedrelliLuca closed 1 year ago
High-level overview of the Components Diagram presented above. Arrows are component dependencies: the black ones are public, and the blue ones are private.
@startuml
skinparam sequenceArrowThickness 2
skinparam sequenceParticipant underline
skinparam linetype ortho
skinparam packageStyle rectangle
package InventoryCore {
}
package Pickups {
}
package InteractionSystem {
}
package InventoryService {
}
package TacticalPauseSystem {
}
package WidgetsPresentation {
}
package GameplayUI {
}
InventoryCore <-- Pickups
InventoryCore <-- WidgetsPresentation
InventoryCore <-[#blue]- InventoryService
Pickups --> InteractionSystem
InventoryService --> WidgetsPresentation
InventoryService -[#blue]-> TacticalPauseSystem
WidgetsPresentation --> GameplayUI
@enduml
This is what the architecture looks like after the refactor. Stability is in the top to bottom direction. ScalarField
is our main module.
@startuml
skinparam sequenceArrowThickness 2
skinparam sequenceParticipant underline
skinparam linetype ortho
skinparam packageStyle rectangle
package SkillUserFSM {}
package InventoryCore {}
package InventoryManipulation {}
package InventoryPresenter {}
package WidgetsPresentation {}
package ScalarField {}
package Pickups {}
package AbstractUI {}
package GameplayUI {}
ScalarField --> InventoryManipulation
ScalarField --> WidgetsPresentation
WidgetsPresentation --> InventoryManipulation
WidgetsPresentation --> InventoryPresenter
WidgetsPresentation --> GameplayUI
WidgetsPresentation --> AbstractUI
GameplayUI --> AbstractUI
ScalarField --> Pickups
Pickups -[#blue]-> InventoryManipulation
InventoryPresenter --> InventoryManipulation
InventoryPresenter --> AbstractUI
ScalarField --> InventoryCore
InventoryCore --> InventoryManipulation
ScalarField --> SkillUserFSM
SkillUserFSM -[#blue]-> InventoryManipulation
InventoryManipulation --> AbstractUI
@enduml
This is a zoom on the InventoryManipulation
module and how InventoryCore
, InventoryPresenter
, and Pickups
depend on it.
@startuml
skinparam sequenceArrowThickness 2
skinparam sequenceParticipant underline
skinparam linetype ortho
skinparam packageStyle rectangle
package ScalarField {
class AScalarFieldPlayerController
class AScalarFieldPickup
}
package SkillUserFSM {
class UInventoryLookupState
}
package InventoryCore {
class UInventoryItem
class UInventoryComponent
UInventoryComponent *-- UInventoryItem
}
package InventoryPresenter {
class UInventoryPresenterWidget
class UInventoryWidget
class UInventoryItemWidget
UInventoryPresenterWidget --> UInventoryWidget
UInventoryWidget --> UInventoryItemWidget
}
package Pickups {
class UPickupComponent
}
AScalarFieldPickup --> UPickupComponent
package InventoryManipulation {
class UInventoryManipulationSubsystem
class UInventoryToggleController
class UItemUsageController
class UPickupSpawnController
interface IInventoryContainerWidget
interface IItemInventoryWidget
interface IItemWidget
interface IInventory
interface IItem
interface IPickup
struct FItemAddResult
IInventory --> IItem
IInventory --> FItemAddResult
IInventoryContainerWidget --> IInventory
IInventoryContainerWidget --> IItemInventoryWidget
IItemInventoryWidget --> IInventory
IItemWidget --> IItem
UInventoryManipulationSubsystem --> UInventoryToggleController
UInventoryManipulationSubsystem --> UItemUsageController
UInventoryManipulationSubsystem --> UPickupSpawnController
UInventoryToggleController --> IInventory
UInventoryToggleController --> IInventoryContainerWidget
UItemUsageController --> IItemInventoryWidget
UPickupSpawnController --> IItemInventoryWidget
UPickupSpawnController --> IPickup
}
AScalarFieldPlayerController --> UInventoryManipulationSubsystem
UInventoryLookupState --> UInventoryManipulationSubsystem
UInventoryItem --|> IItem
UInventoryComponent --|> IInventory
UInventoryPresenterWidget --|> IInventoryContainerWidget
UInventoryWidget --|> IItemInventoryWidget
UInventoryItemWidget --|> IItemWidget
UInventoryItemWidget --> IItem
UPickupComponent --> IItem
UPickupComponent --> IInventory
AScalarFieldPickup --|> IPickup
package InteractionSystem {
interface IInteractor
class UInteractableComponent
}
UPickupComponent --> IInteractor
UPickupComponent --> UInteractableComponent
package AbstractUI {
interface IPawnBindableWidget
interface IClosableWidget
}
UInventoryToggleController --> IPawnBindableWidget
IInventoryContainerWidget --|> IClosableWidget
@enduml
Diagram showing the command + factory pattern realized to queue a single inventory operation at a time during the tactical pause (see here)
@startuml
skinparam sequenceArrowThickness 2
skinparam sequenceParticipant underline
skinparam linetype ortho
skinparam packageStyle rectangle
package InventoryManipulation {
class UItemUsageController
class UItemUsageCommand
class UItemUsageCommandFactory
UItemUsageController --> UItemUsageCommandFactory
UItemUsageCommandFactory -[#blue]-> UItemUsageCommand
class UPickupSpawnController
class UPickupSpawnCommand
class UPickupSpawnCommandFactory
UPickupSpawnController --> UPickupSpawnCommandFactory
UPickupSpawnCommandFactory -[#blue]-> UPickupSpawnCommand
}
package TacticalPauseSystem {
class UTacticalPauseWorldSubsystem
interface IPauseCommand
interface IPauseCommandFactory
IPauseCommandFactory --> IPauseCommand
UTacticalPauseWorldSubsystem --> IPauseCommand
}
UItemUsageCommandFactory --|> IPauseCommandFactory
UItemUsageCommand --|> IPauseCommand
UPickupSpawnCommandFactory --|> IPauseCommandFactory
UPickupSpawnCommand --|> IPauseCommand
@enduml
Current Components (a.k.a. Modules) Diagram for the Inventory and Pickup systems. Arrows are source code dependencies: the black ones are
#include
s in.h
files, and the blue ones are in.cpp
files.