Advertisement
OwlyOwl

database_v.1999

Jul 6th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace PlayerDataBase
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.  
  11.         }
  12.  
  13.         class Player
  14.         {
  15.             private int _playerNum;
  16.             private string _nickname;
  17.             internal bool Restriction;
  18.             private int _level;
  19.  
  20.             public Player(int playerNum, string nickname, int level, bool restriction)
  21.             {
  22.                 _playerNum = playerNum;
  23.                 _nickname = nickname;
  24.                 _level = level;
  25.                 Restriction = restriction;
  26.             }
  27.         }
  28.  
  29.         class PlayerList
  30.         {
  31.             List<Player> playerList = new List<Player>();
  32.  
  33.             private void AddPlayer(List<Player> playerList, int playerNum, string nickname, int level, bool restriction)
  34.             {
  35.                 Player newPlayer = new Player(playerNum, nickname, level, restriction);
  36.                 playerList.Add(newPlayer);
  37.             }
  38.  
  39.             private void BanPlayer(int playerNumber, List<Player> playerList)
  40.             {
  41.                 playerList[playerNumber - 1].Restriction = true;
  42.             }
  43.  
  44.             private void UnbanPlayer(int playerNumber, List<Player> playerList)
  45.             {
  46.                 playerList[playerNumber - 1].Restriction = false;
  47.             }
  48.  
  49.             private void RemovePlayer(int playerNumber, List<Player> playerList)
  50.             {
  51.                 playerList.RemoveAt(playerNumber + 1);
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement