59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
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}");
|
|
}
|
|
}
|
|
}
|