diff options
Diffstat (limited to 'docs/class-diag.puml')
-rw-r--r-- | docs/class-diag.puml | 70 |
1 files changed, 48 insertions, 22 deletions
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" <<group>> { class CollisionContext { + CollisionContext(Museum &) + update() + -- + get_checker() : shared<CollisionChecker> + cycle_method() - -- - - museum : Museum & - checker : shared<CollisionChecker> - - checker_index : size_t - create_checker() : shared<CollisionChecker> + - checker_index : size_t + -- + - museum : Museum & } class CollisionChecker <<abstract>> { + CollisionChecker(Museum &) - + compare(Artist & a, Artist & b) + check() <<pure virtual>> -- + + compare(Artist & a, Artist & b) + -- # museum : Museum & } class QuadTreeCollisionChecker { @@ -148,11 +150,11 @@ rectangle Group_Collisions as "Collisions" <<group>> { rectangle Group_Pathfinding as "Pathfinding" <<group>> { 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" <<group>> { -- + get_solver() : Pathfinder & + cycle_solver() - -- - solvers : vec<uniq<Pathfinder>> - solver_index : size_t + -- + + has_collision : bool + -- - museum : Museum & } class Pathfinder <<abstract>> { + Pathfinder(Museum &) + find_between(const XY &, const XY &) <<pure virtual> - + get_path() : const forward_list<XY> & <<pure virtual>> -- + is_visited(const XY &) : bool - # set_visited(const XY &) + + is_solution(const XY &) : bool + + is_solved() : bool + + get_solution() : const forward_list<XY> & -- # clear() + # set_visited(const XY &) + # set_solved(const forward_list<XY> &) + -- - visited : vec<bool> + - solution : vec<bool> + - path : forward_list<XY> + - solved : bool -- # museum : Museum & } class BreadthFirstPathfinder { + find_between(const XY &, const XY &) - + get_path() : const forward_list<XY> & -- - find_step(const vec<forward_list<XY>> &) : vec<forward_list<XY>> - - solution : forward_list<XY> - end : XY - -- - # clear() } class DijkstraPathfinder { + find_between(const XY &, const XY &) - + get_path() : const forward_list<XY> & + -- + # clear() + - end : XY + - map_get(const XY &) : Node & + - map : unordered_map<XY, Node> + - dijkstra(const XY &) } Pathfinder <|-- BreadthFirstPathfinder @@ -238,6 +250,7 @@ rectangle Group_Model as "Model" <<group>> { } class People { + People(Museum &) + + update(tick : bool) -- + add_artist(ArtistData) + remove_artist(Artist &) @@ -266,7 +279,7 @@ rectangle Group_Model as "Model" <<group>> { + type : string } class Artist { - + update() + + update(tick : bool) + step : bool + color : Color + data : ArtistData @@ -423,9 +436,6 @@ rectangle Group_Commands as "Commands" <<group>> { 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" <<group>> { 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 '/ |