Advertisement
OwlyOwl

database123123

Jun 28th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.48 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.             List<Player> playerList = new List<Player>();
  11.         }
  12.  
  13.         class Player
  14.         {
  15.             public int PlayerNum;
  16.             public string Nickname;
  17.             public bool Restriction;
  18.             public 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.             private void AddPlayer(List<Player> playerList, int playerNum, string nickname, int level, bool restriction)
  29.             {
  30.                 Player newPlayer = new Player(playerNum, nickname, level, restriction);
  31.                 playerList.Add(newPlayer);
  32.             }
  33.  
  34.             private void BanPlayer(int playerNumber, List<Player> playerList)
  35.             {
  36.                 playerList[playerNumber - 1].Restriction = true;
  37.             }
  38.  
  39.             private void UnbanPlayer(int playerNumber, List<Player> playerList)
  40.             {
  41.                 playerList[playerNumber - 1].Restriction = false;
  42.             }
  43.  
  44.             private void RemovePlayer(int playerNumber, List<Player> playerList)
  45.             {
  46.                 playerList.RemoveAt(playerNumber + 1);
  47.             }
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement