public GunShop Reload(GunShop shop) { var oldShop = Shop; Shop = shop; StateChanged?.Invoke(); return(oldShop); }
public static GunShop GetPistolShop(int bulletCount = 0) { var shop = new GunShop(8); for (var i = 0; i < bulletCount; i++) { shop.TryPushBullet(Bullet.GetPistolBullet()); } return(shop); }
public static Pistol GetRandomPistol() { var pistol = new Pistol(); var shop = GunShop.GetPistolShop(8); for (var i = 0; i < new Random().Next(1, 8); i++) { shop.TryPushBullet(Bullet.GetPistolBullet()); } pistol.Reload(shop); return(pistol); }
public Pistol(int bulletCount = 0) { Shop = GunShop.GetPistolShop(bulletCount); }