Advertisement
OwlyOwl

dsksksksk

Apr 14th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2.  
  3. namespace BazaDannihIgrokov
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Player player1 = new Player(1, "owly", 1, false);
  10.             Player player2 = new Player(2, "shadowdemon1999rus_pro", 1, false);
  11.             Player player3 = new Player(3, "vasya_skilluha", 1, false);
  12.             player1.PlayerBan();
  13.             player1.PlayerUnban();
  14.             player3.DeletePlayer(player3);
  15.         }
  16.     }
  17.  
  18.     class Player
  19.     {
  20.         public int PlayerNum;
  21.         public string Nickname;
  22.         public bool Restrict;
  23.         public int Level;
  24.  
  25.         public Player(int playerNum, string nickname, int level, bool restrict)
  26.         {
  27.             PlayerNum = playerNum;
  28.             Nickname = nickname;
  29.             Level = level;
  30.             Restrict = restrict;
  31.         }
  32.  
  33.         public Player()
  34.         {
  35.             PlayerNum = 0;
  36.             Nickname = null;
  37.             Level = 0;
  38.             Restrict = false;
  39.         }
  40.  
  41.         public bool PlayerBan()
  42.         {
  43.             Restrict = true;
  44.             return Restrict;
  45.         }
  46.  
  47.         public bool PlayerUnban()
  48.         {
  49.             Restrict = false;
  50.             return Restrict;
  51.         }
  52.  
  53.         public void DeletePlayer(Player tempPlayer)
  54.         {
  55.             tempPlayer = new Player();
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement