diff options
| author | Fuwn <[email protected]> | 2025-11-20 21:39:18 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-11-20 21:53:25 -0800 |
| commit | 5ccd4667082a7ba69b737d252e239c3ac77fe658 (patch) | |
| tree | bbd4060335beb4332574993f499310b53ebed1d4 /diagrams/assignment_3/mmd/template_method_pattern.mmd | |
| parent | feat: Implement Assignment 3 functionality (diff) | |
| download | cst276-5ccd4667082a7ba69b737d252e239c3ac77fe658.tar.xz cst276-5ccd4667082a7ba69b737d252e239c3ac77fe658.zip | |
feat: Add Assignment 3 diagram sources
Diffstat (limited to 'diagrams/assignment_3/mmd/template_method_pattern.mmd')
| -rw-r--r-- | diagrams/assignment_3/mmd/template_method_pattern.mmd | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/diagrams/assignment_3/mmd/template_method_pattern.mmd b/diagrams/assignment_3/mmd/template_method_pattern.mmd new file mode 100644 index 0000000..96e7605 --- /dev/null +++ b/diagrams/assignment_3/mmd/template_method_pattern.mmd @@ -0,0 +1,26 @@ +classDiagram + class Simulator~T~ { + <<abstract>> + +Run(runTime: int) + #ProcessTimeStep() + #FindPreyIfNeeded(entity: T) + #CheckAndFeed(entity: T) + #FindNearestPrey(predator: T) Entity* + } + + class Dish { + #FindNearestPrey(predator: Morg) Entity* + } + + Simulator~T~ <|-- Dish + + note for Simulator~T~ "Template Method Pattern: +Run() defines the algorithm +ProcessTimeStep() is the template +FindPreyIfNeeded() is virtual +CheckAndFeed() is virtual +FindNearestPrey() is abstract" + + note for Dish "Concrete implementation: +Implements FindNearestPrey() +for Morg-specific prey finding" |