Update Lesson 4 Task 2

This commit is contained in:
Stanislav Mykhailenko 2023-04-15 22:39:32 +03:00
parent 92fa284e20
commit 39d4c9a4d1
GPG key ID: 1E95E66A9C9D6A36
3 changed files with 5 additions and 5 deletions

View file

@ -10,9 +10,9 @@ namespace Open_Closed.Classes
{ {
public class Magic : IMagic 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}.");
} }
} }
} }

View file

@ -8,6 +8,6 @@ namespace Open_Closed.Interfaces
{ {
public interface IMagic public interface IMagic
{ {
void CountYourMagic(IMagicClass MagicClass); void CountYourMagic(string MagicType);
} }
} }

View file

@ -1,4 +1,4 @@
using Open_Closed.Classes; using Open_Closed.Classes;
(new Magic()).CountYourMagic(new FireMagic()); (new Magic()).CountYourMagic(new FireMagic().MagicType);
(new Magic()).CountYourMagic(new WaterMagic()); (new Magic()).CountYourMagic(new WaterMagic().MagicType);