Advertisement
OwlyOwl

Player_database

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