Update Lesson 4 Task 2
This commit is contained in:
parent
42aebfd7c7
commit
f24c97cfb5
6 changed files with 21 additions and 8 deletions
|
@ -8,7 +8,7 @@ using Open_Closed.Interfaces;
|
||||||
|
|
||||||
namespace Open_Closed.Classes
|
namespace Open_Closed.Classes
|
||||||
{
|
{
|
||||||
public class FireMagic : IMagic
|
public class FireMagic : IMagicClass
|
||||||
{
|
{
|
||||||
public int MagicValue { get { return 150; } }
|
public int MagicValue { get { return 150; } }
|
||||||
public string MagicType { get { return "fire"; } }
|
public string MagicType { get { return "fire"; } }
|
||||||
|
|
|
@ -8,11 +8,11 @@ using Open_Closed.Interfaces;
|
||||||
|
|
||||||
namespace Open_Closed.Classes
|
namespace Open_Closed.Classes
|
||||||
{
|
{
|
||||||
public class Magic
|
public class Magic : IMagic
|
||||||
{
|
{
|
||||||
public void CountYourMagic(IMagic Magic)
|
public void CountYourMagic(IMagicClass MagicClass)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Your magic is {Magic.MagicType}.");
|
Console.WriteLine($"Your magic is {MagicClass.MagicType}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ using Open_Closed.Interfaces;
|
||||||
|
|
||||||
namespace Open_Closed.Classes
|
namespace Open_Closed.Classes
|
||||||
{
|
{
|
||||||
public class WaterMagic : IMagic
|
public class WaterMagic : IMagicClass
|
||||||
{
|
{
|
||||||
public int MagicValue { get { return 50000000; } }
|
public int MagicValue { get { return 50000000; } }
|
||||||
public string MagicType { get { return "water"; } }
|
public string MagicType { get { return "water"; } }
|
||||||
|
|
|
@ -8,7 +8,6 @@ namespace Open_Closed.Interfaces
|
||||||
{
|
{
|
||||||
public interface IMagic
|
public interface IMagic
|
||||||
{
|
{
|
||||||
int MagicValue { get; }
|
void CountYourMagic(IMagicClass MagicClass);
|
||||||
string MagicType { get; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
Lesson_4/Task_2/Interfaces/IMagicClass.cs
Normal file
14
Lesson_4/Task_2/Interfaces/IMagicClass.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Open_Closed.Interfaces
|
||||||
|
{
|
||||||
|
public interface IMagicClass
|
||||||
|
{
|
||||||
|
int MagicValue { get; }
|
||||||
|
string MagicType { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
Reference in a new issue