Advertisement
OwlyOwl

nedodelka

Apr 10th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace BazaDannihIgrokov
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             bool isOpen = true;
  10.             while (isOpen)
  11.             {
  12.                 Console.WriteLine("База данных игроков");
  13.                 Console.WriteLine("\nДобавить игрока - 1\nЗабанить игрока - 2\nРазбанить игрока - 3\nExit -4");
  14.                 int input = Convert.ToInt32(Console.ReadLine());
  15.                 switch (input)
  16.                 {
  17.                     case 1:
  18.                         Player.CreatePlayer();
  19.                         break;
  20.                     case 2:
  21.                         Console.WriteLine("Введи номер игрока:");
  22.                         break;
  23.                     case 3:
  24.                         Console.WriteLine("Введи номер игрока:");
  25.                         break;
  26.                     case 4:
  27.                         isOpen = false;
  28.                         break;
  29.                 }
  30.             }
  31.         }
  32.     }
  33.  
  34.     class Player
  35.     {
  36.         public int PlayerNum;
  37.         public string Nickname;
  38.         public bool Restrict;
  39.         public int Level;
  40.  
  41.         public Player(int playerNum, string nickname, int level, bool restrict)
  42.         {
  43.             PlayerNum = playerNum;
  44.             Nickname = nickname;
  45.             Level = level;
  46.             Restrict = restrict;
  47.         }
  48.  
  49.         public static void CreatePlayer()
  50.         {
  51.             int userNum = 1;
  52.             Console.WriteLine("Введи имя:");
  53.             string userInput = Convert.ToString(Console.ReadLine());
  54.             Player player1 = new Player(userNum, userInput, 1, false);
  55.             userNum++;
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement