Update Lesson 4 Task 2
This commit is contained in:
parent
92fa284e20
commit
39d4c9a4d1
3 changed files with 5 additions and 5 deletions
|
@ -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}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,6 @@ namespace Open_Closed.Interfaces
|
||||||
{
|
{
|
||||||
public interface IMagic
|
public interface IMagic
|
||||||
{
|
{
|
||||||
void CountYourMagic(IMagicClass MagicClass);
|
void CountYourMagic(string MagicType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Reference in a new issue