aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/class-diag.puml94
1 files changed, 54 insertions, 40 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml
index b20b3e1..2d890d5 100644
--- a/docs/class-diag.puml
+++ b/docs/class-diag.puml
@@ -149,6 +149,19 @@ rectangle Group_Pathfinding as "Pathfinding" <<group>> {
class PathfindingContext {
+ PathfindingContext(Museum &)
}
+ class Pathfinder <<abstract>> {
+ + Pathfinder(Museum &)
+ --
+ # museum : Museum &
+ }
+ class BreadthFirstPathfinder {
+ }
+ class DijkstraPathfinder {
+ }
+
+ Pathfinder <|-- BreadthFirstPathfinder
+ Pathfinder <|-- DijkstraPathfinder
+ PathfindingContext -> Pathfinder
}
rectangle Group_Model as "Model" <<group>> {
class Museum {
@@ -179,6 +192,9 @@ rectangle Group_Model as "Model" <<group>> {
+ data : CanvasData
+ set_data(CanvasData)
--
+ + tile_color : TileColorFactory
+ + tile_behavior : TileBehaviorFactory
+ --
- tiles : vector<Tile *>
- museum : Museum &
}
@@ -230,19 +246,23 @@ rectangle Group_Model as "Model" <<group>> {
+ vx : float
+ vy : float
}
+ class TileColorFactory <<factory>> {
+ + get_color(string) : Color <<static>>
+ + register_color(string, Color) <<static>>
+ }
+ class TileBehaviorFactory <<factory>> {
+ + TileBehaviorFactory(Museum &)
+ + create(string) : uniq<TileBehavior>
+ --
+ - museum : Museum &
+ }
}
- together {
struct Color {
red : unsigned int
green : unsigned int
blue : unsigned int
}
- class TileColorFactory <<factory>> <<singleton>> {
- + get_color(string) : Color <<static>>
- + register_color(string, Color) <<static>>
- }
- }
together {
interface TileBehavior {
@@ -254,40 +274,32 @@ rectangle Group_Model as "Model" <<group>> {
# interactions : unsigned int
# museum : Museum &
}
- class TileBehaviorFactory <<factory>> {
- + TileBehaviorFactory(Museum &)
- + create(string) : uniq<TileBehavior>
- --
- - museum : Museum &
- }
- }
- together {
- class NullTileBehavior {
- - type = "" <<static constexpr>>
- }
- class StepTileBehavior {
- - type = "G" : <<static constexpr>>
- }
- class DeleteArtistTileBehavior {
- - type = "R" : <<static constexpr>>
- }
- class SetNeighborTileBehavior {
- - type = "B" : <<static constexpr>>
- --
- - dx : int
- - dy : int
- }
- class CreateArtistTileBehavior {
- - type = "Y" : <<static constexpr>>
- --
- - last_interactions : unsigned int
- }
-
- NullTileBehavior -d[hidden]- StepTileBehavior
- StepTileBehavior -d[hidden]- DeleteArtistTileBehavior
- DeleteArtistTileBehavior -d[hidden]- SetNeighborTileBehavior
- SetNeighborTileBehavior -d[hidden]- CreateArtistTileBehavior
+ class NullTileBehavior {
+ - type = "" <<constexpr>>
+ }
+ class StepTileBehavior {
+ - type = "G" : <<constexpr>>
+ }
+ class DeleteArtistTileBehavior {
+ - type = "R" : <<constexpr>>
+ }
+ class SetNeighborTileBehavior {
+ - type = "B" : <<constexpr>>
+ --
+ - dx : int
+ - dy : int
+ }
+ class CreateArtistTileBehavior {
+ - type = "Y" : <<constexpr>>
+ --
+ - last_interactions : unsigned int
+ }
+
+ NullTileBehavior -d[hidden]- StepTileBehavior
+ StepTileBehavior -d[hidden]- DeleteArtistTileBehavior
+ DeleteArtistTileBehavior -d[hidden]- SetNeighborTileBehavior
+ SetNeighborTileBehavior -d[hidden]- CreateArtistTileBehavior
}
Canvas -l[hidden] People
@@ -296,6 +308,8 @@ rectangle Group_Model as "Model" <<group>> {
Museum --> Canvas
Canvas --> Tile
+ Canvas --> TileColorFactory
+ Canvas --> TileBehaviorFactory
People --> Artist
Tile -> TileData
@@ -303,7 +317,7 @@ rectangle Group_Model as "Model" <<group>> {
Canvas -> CanvasData
Tile --> "state" Color
- Tile .[norank].> TileColorFactory
+ Tile .> TileColorFactory
TileColorFactory -> Color