Abdula_2314124

Untitled

Feb 18th, 2024
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace Directory
  5. {
  6.     // Вибір зброї (5 штук)
  7.     // Добавити можливість ремонту зброї но з шансом
  8.     // Патрони для кожної зброї (enum) новий клас Bullet
  9.     // Всі циферки, консоле.РайтКейт в окремі зміни створити
  10.  
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             Gun pistol = new Gun("Makarov", 12, GunTypes.Melee, QualityTypeGun.New);
  16.  
  17.             while (true)
  18.             {
  19.                 if(Console.ReadKey().KeyChar == 'f' && !(pistol.GetCounterQuality() <= 0))
  20.                 {
  21.                     pistol.Shoot();
  22.                 }
  23.  
  24.                 if (pistol.GetCounterQuality() <= 0)
  25.                 {
  26.                     pistol.End();
  27.                 }
  28.  
  29.                 if (pistol.GetCountAmmo() <= 0)
  30.                 {
  31.                     Console.WriteLine("Патронів німа треба перезарядка, натисність r");
  32.                     if(Console.ReadKey().KeyChar == 'r')
  33.                         pistol.Reload();
  34.                 }
  35.             }
  36.            
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment