Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace PlayerDataBase
- {
- class Program
- {
- static void Main(string[] args)
- {
- }
- class Player
- {
- private int _playerNum;
- private string _nickname;
- internal bool Restriction;
- private int _level;
- public Player(int playerNum, string nickname, int level, bool restriction)
- {
- _playerNum = playerNum;
- _nickname = nickname;
- _level = level;
- Restriction = restriction;
- }
- }
- class PlayerList
- {
- List<Player> playerList = new List<Player>();
- private void AddPlayer(List<Player> playerList, int playerNum, string nickname, int level, bool restriction)
- {
- Player newPlayer = new Player(playerNum, nickname, level, restriction);
- playerList.Add(newPlayer);
- }
- private void BanPlayer(int playerNumber, List<Player> playerList)
- {
- playerList[playerNumber - 1].Restriction = true;
- }
- private void UnbanPlayer(int playerNumber, List<Player> playerList)
- {
- playerList[playerNumber - 1].Restriction = false;
- }
- private void RemovePlayer(int playerNumber, List<Player> playerList)
- {
- playerList.RemoveAt(playerNumber + 1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement