yeah
This commit is contained in:
31
Program.cs
Normal file
31
Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace Practice6_Presnyakov
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
CheatSuspectAccount cheater = new CheatSuspectAccount("NeoSniper", 72, 12);
|
||||
|
||||
Console.WriteLine("=== Вызовы через ссылку производного типа (CheatSuspectAccount) ===");
|
||||
cheater.Login();
|
||||
cheater.ReportPlayer("Innocent");
|
||||
cheater.PerformCheck();
|
||||
cheater.ApplyPenalty();
|
||||
cheater.ShowStatus();
|
||||
cheater.WriteLog(":D");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("=== Разницы override vs new (Mortal Kombat) ===");
|
||||
|
||||
PlayerAccount asBase = cheater;
|
||||
|
||||
asBase.PerformCheck();
|
||||
asBase.ApplyPenalty();
|
||||
|
||||
asBase.ShowStatus();
|
||||
asBase.WriteLog("Based :p");
|
||||
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user