diff options
| author | Fuwn <[email protected]> | 2025-10-16 20:23:12 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-16 20:23:12 -0700 |
| commit | c9d655807d0046be1fa2cd19991354b703c55c87 (patch) | |
| tree | ac14221c639baf208c01cc11ee01649d9eef05b7 /MorgSimulator/FeedingStrategy | |
| download | cst276-c9d655807d0046be1fa2cd19991354b703c55c87.tar.xz cst276-c9d655807d0046be1fa2cd19991354b703c55c87.zip | |
feat: Implement Assignment 1 functionality
Diffstat (limited to 'MorgSimulator/FeedingStrategy')
| -rw-r--r-- | MorgSimulator/FeedingStrategy/FeedingStrategyAbsorbs.cs | 12 | ||||
| -rw-r--r-- | MorgSimulator/FeedingStrategy/FeedingStrategyEnvelops.cs | 12 |
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; + } + } +} |