This commit is contained in:
2026-02-17 06:46:24 +03:00
commit 571d6cd8a5
6 changed files with 559 additions and 0 deletions

58
PlayerAccount.cs Normal file
View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practice6_Presnyakov
{
internal class PlayerAccount
{
public string Nickname { get; set; }
public int Level { get; set; }
public int Reputation { get; set; }
public bool IsBanned { get; protected set; }
public PlayerAccount(string nickname, int level, int reputation)
{
Nickname = nickname;
Level = level;
Reputation = reputation;
IsBanned = false;
}
public void Login()
{
Console.WriteLine($"[LOGIN] {Nickname} вошёл в систему. Уровень: {Level}, репутация: {Reputation}");
}
public void ReportPlayer(string targetNickname)
{
Console.WriteLine($"[REPORT] {Nickname} пожаловался на игрока: {targetNickname}");
WriteLog($"Report created by {Nickname} on {targetNickname}");
}
public virtual void PerformCheck()
{
Console.WriteLine($"[CHECK] Базовая проверка аккаунта {Nickname}: всё выглядит (пока) нормально.");
WriteLog("Base behavior check completed");
}
public virtual void ApplyPenalty()
{
Reputation = Math.Max(0, Reputation - 10);
Console.WriteLine($"[PENALTY] {Nickname}: репутация снижена до {Reputation}");
WriteLog("Base penalty applied: reputation -10");
}
public void ShowStatus()
{
Console.WriteLine($"[STATUS] {Nickname}: Level={Level}, Rep={Reputation}, Banned={IsBanned}");
}
public void WriteLog(string msg)
{
Console.WriteLine($"[LOG:player] {Nickname}: {msg}");
}
}
}