From 39d4c9a4d12c5a1045fb25e40c192b58ceba2d8d Mon Sep 17 00:00:00 2001 From: Stanislav Mykhailenko Date: Sat, 15 Apr 2023 22:39:32 +0300 Subject: [PATCH] Update Lesson 4 Task 2 --- Lesson_4/Task_2/Classes/Magic.cs | 4 ++-- Lesson_4/Task_2/Interfaces/IMagic.cs | 2 +- Lesson_4/Task_2/Program.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lesson_4/Task_2/Classes/Magic.cs b/Lesson_4/Task_2/Classes/Magic.cs index 0024c62..2bb046f 100644 --- a/Lesson_4/Task_2/Classes/Magic.cs +++ b/Lesson_4/Task_2/Classes/Magic.cs @@ -10,9 +10,9 @@ namespace Open_Closed.Classes { public class Magic : IMagic { - public void CountYourMagic(IMagicClass MagicClass) + public void CountYourMagic(string MagicType) { - Console.WriteLine($"Your magic is {MagicClass.MagicType}."); + Console.WriteLine($"Your magic is {MagicType}."); } } } diff --git a/Lesson_4/Task_2/Interfaces/IMagic.cs b/Lesson_4/Task_2/Interfaces/IMagic.cs index 417e11d..d2599f7 100644 --- a/Lesson_4/Task_2/Interfaces/IMagic.cs +++ b/Lesson_4/Task_2/Interfaces/IMagic.cs @@ -8,6 +8,6 @@ namespace Open_Closed.Interfaces { public interface IMagic { - void CountYourMagic(IMagicClass MagicClass); + void CountYourMagic(string MagicType); } } diff --git a/Lesson_4/Task_2/Program.cs b/Lesson_4/Task_2/Program.cs index 3177504..207c754 100644 --- a/Lesson_4/Task_2/Program.cs +++ b/Lesson_4/Task_2/Program.cs @@ -1,4 +1,4 @@ using Open_Closed.Classes; -(new Magic()).CountYourMagic(new FireMagic()); -(new Magic()).CountYourMagic(new WaterMagic()); +(new Magic()).CountYourMagic(new FireMagic().MagicType); +(new Magic()).CountYourMagic(new WaterMagic().MagicType);