Advertisement
OwlyOwl

BibleThump

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