From c9f5ac8722190efeb58fda1eec9e6160d5204127 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 25 Oct 2024 14:34:40 +0200 Subject: update class-diag.puml --- docs/class-diag.puml | 70 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 22 deletions(-) (limited to 'docs/class-diag.puml') diff --git a/docs/class-diag.puml b/docs/class-diag.puml index bf19cf3..9ce43eb 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -102,19 +102,21 @@ rectangle Group_Collisions as "Collisions" <> { class CollisionContext { + CollisionContext(Museum &) + update() + -- + get_checker() : shared + cycle_method() - -- - - museum : Museum & - checker : shared - - checker_index : size_t - create_checker() : shared + - checker_index : size_t + -- + - museum : Museum & } class CollisionChecker <> { + CollisionChecker(Museum &) - + compare(Artist & a, Artist & b) + check() <> -- + + compare(Artist & a, Artist & b) + -- # museum : Museum & } class QuadTreeCollisionChecker { @@ -148,11 +150,11 @@ rectangle Group_Collisions as "Collisions" <> { rectangle Group_Pathfinding as "Pathfinding" <> { class PathfindingContext { + PathfindingContext(Museum &) + + update() -- - start_point : XY <<+get>> <<+set>> - end_point : XY <<+get>> <<+set>> - + valid_point(const XY &) : bool - + update() + + empty_point(const XY &) : bool -- + register_weight(type : const string &, weight : unsigned int) + get_weight(type : const string &) : unsigned int @@ -160,37 +162,47 @@ rectangle Group_Pathfinding as "Pathfinding" <> { -- + get_solver() : Pathfinder & + cycle_solver() - -- - solvers : vec> - solver_index : size_t + -- + + has_collision : bool + -- - museum : Museum & } class Pathfinder <> { + Pathfinder(Museum &) + find_between(const XY &, const XY &) < - + get_path() : const forward_list & <> -- + is_visited(const XY &) : bool - # set_visited(const XY &) + + is_solution(const XY &) : bool + + is_solved() : bool + + get_solution() : const forward_list & -- # clear() + # set_visited(const XY &) + # set_solved(const forward_list &) + -- - visited : vec + - solution : vec + - path : forward_list + - solved : bool -- # museum : Museum & } class BreadthFirstPathfinder { + find_between(const XY &, const XY &) - + get_path() : const forward_list & -- - find_step(const vec> &) : vec> - - solution : forward_list - end : XY - -- - # clear() } class DijkstraPathfinder { + find_between(const XY &, const XY &) - + get_path() : const forward_list & + -- + # clear() + - end : XY + - map_get(const XY &) : Node & + - map : unordered_map + - dijkstra(const XY &) } Pathfinder <|-- BreadthFirstPathfinder @@ -238,6 +250,7 @@ rectangle Group_Model as "Model" <> { } class People { + People(Museum &) + + update(tick : bool) -- + add_artist(ArtistData) + remove_artist(Artist &) @@ -266,7 +279,7 @@ rectangle Group_Model as "Model" <> { + type : string } class Artist { - + update() + + update(tick : bool) + step : bool + color : Color + data : ArtistData @@ -423,9 +436,6 @@ rectangle Group_Commands as "Commands" <> { class ToggleMuseumPauseCommand { + constructor(Museum &) + constructor(Museum &, set : bool) - -- - toggle : bool - value : bool } class OpenFileGUICommand { + constructor(Museum &, View &) @@ -464,14 +474,30 @@ rectangle Group_Commands as "Commands" <> { class CycleCollisionMethodCommand { + constructor(Museum &) } + class ToggleArtistPathCollisionCommand { + + constructor(Museum &) + } + class SetPathfindingStartPointCommand { + + constructor(Museum &) + - museum : Museum & + - point : XY + } + class SetPathfindingEndPointCommand { + + constructor(Museum &) + - museum : Museum & + - point : XY + } - Command <|-d- ToggleMuseumPauseCommand - Command <|-u- OpenFileGUICommand - Command <|-u- ControlBooleanCommand Command <|-d- StepTileCommand Command <|-d- LoadFilesCommand Command <|-d- TimeTravelCommand - Command <|-u- CycleCollisionMethodCommand + Command <|-d- CycleCollisionMethodCommand + Command <|-u- OpenFileGUICommand + Command <|-u- ControlBooleanCommand + Command <|-u- SetPathfindingStartPointCommand + Command <|-u- SetPathfindingEndPointCommand + ControlBooleanCommand <|-u- ToggleMuseumPauseCommand + ControlBooleanCommand <|-u- ToggleArtistPathCollisionCommand } } /' LAYOUT '/ -- cgit v1.2.3