Update Lesson 4 Task 2

This commit is contained in:
Stanislav Mykhailenko 2023-04-09 21:00:28 +03:00
parent 49f7d01245
commit b5db4e4640
GPG key ID: 1E95E66A9C9D6A36
3 changed files with 32 additions and 16 deletions

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Open_Closed
{
public class FireMagic : Magic
{
public override void CountYourMagic()
{
Console.WriteLine("Wow, your magic is fire magic!");
}
}
}

16
Lesson_4/Task_2/Magic.cs Normal file
View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Open_Closed
{
public class Magic
{
public virtual void CountYourMagic()
{
Console.WriteLine("I understand you...");
}
}
}

View file

@ -6,14 +6,6 @@ using System.Threading.Tasks;
namespace Open_Closed namespace Open_Closed
{ {
public class FireMagic : Magic
{
public override void CountYourMagic()
{
Console.WriteLine("Wow, your magic is fire magic!");
}
}
public class WaterMagic : Magic public class WaterMagic : Magic
{ {
public override void CountYourMagic() public override void CountYourMagic()
@ -21,12 +13,4 @@ namespace Open_Closed
Console.WriteLine("Incredible! You have 50 millions of power! It's water magic!"); Console.WriteLine("Incredible! You have 50 millions of power! It's water magic!");
} }
} }
public class Magic
{
public virtual void CountYourMagic()
{
Console.WriteLine("I understand you...");
}
}
} }