summaryrefslogtreecommitdiff
path: root/MorgSimulator/FeedingStrategy
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-10-16 20:23:12 -0700
committerFuwn <[email protected]>2025-10-16 20:23:12 -0700
commitc9d655807d0046be1fa2cd19991354b703c55c87 (patch)
treeac14221c639baf208c01cc11ee01649d9eef05b7 /MorgSimulator/FeedingStrategy
downloadcst276-c9d655807d0046be1fa2cd19991354b703c55c87.tar.xz
cst276-c9d655807d0046be1fa2cd19991354b703c55c87.zip
feat: Implement Assignment 1 functionality
Diffstat (limited to 'MorgSimulator/FeedingStrategy')
-rw-r--r--MorgSimulator/FeedingStrategy/FeedingStrategyAbsorbs.cs12
-rw-r--r--MorgSimulator/FeedingStrategy/FeedingStrategyEnvelops.cs12
2 files changed, 24 insertions, 0 deletions
diff --git a/MorgSimulator/FeedingStrategy/FeedingStrategyAbsorbs.cs b/MorgSimulator/FeedingStrategy/FeedingStrategyAbsorbs.cs
new file mode 100644
index 0000000..9e0f9a0
--- /dev/null
+++ b/MorgSimulator/FeedingStrategy/FeedingStrategyAbsorbs.cs
@@ -0,0 +1,12 @@
+namespace MorgSimulator
+{
+ public class FeedingStrategyAbsorbs : IFeedingStrategy
+ {
+ public void Feed(Morg predator, Morg prey)
+ {
+ System.Console.WriteLine($"Morg {predator.Id} Absorbs Morg {prey.Id} at ({prey.Location.x},{prey.Location.y})");
+
+ prey.IsAlive = false;
+ }
+ }
+}
diff --git a/MorgSimulator/FeedingStrategy/FeedingStrategyEnvelops.cs b/MorgSimulator/FeedingStrategy/FeedingStrategyEnvelops.cs
new file mode 100644
index 0000000..d35227c
--- /dev/null
+++ b/MorgSimulator/FeedingStrategy/FeedingStrategyEnvelops.cs
@@ -0,0 +1,12 @@
+namespace MorgSimulator
+{
+ public class FeedingStrategyEnvelops : IFeedingStrategy
+ {
+ public void Feed(Morg predator, Morg prey)
+ {
+ System.Console.WriteLine($"Morg {predator.Id} Envelops Morg {prey.Id} at ({prey.Location.x},{prey.Location.y})");
+
+ prey.IsAlive = false;
+ }
+ }
+}