summaryrefslogtreecommitdiff
path: root/diagrams/assignment_3/mmd/template_method_pattern.mmd
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-11-20 21:39:18 -0800
committerFuwn <[email protected]>2025-11-20 21:53:25 -0800
commit5ccd4667082a7ba69b737d252e239c3ac77fe658 (patch)
treebbd4060335beb4332574993f499310b53ebed1d4 /diagrams/assignment_3/mmd/template_method_pattern.mmd
parentfeat: Implement Assignment 3 functionality (diff)
downloadcst276-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.mmd26
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"