Exemple #1
0
 public override bool Buy(TypeOFBullets bullet, IShip ship, IPlayer player)
 {
     if (bullet == TypeOFBullets.Kamikaze && ship[TypeOfGun.RocketGun] && ship.NumOfCrazyAlbatroses < 1)
     {
         ship.NumOfCrazyAlbatroses++;
         player.Money -= shop.GetPrice(TypeOFBullets.Kamikaze.ToString());
         return(true);
     }
     if (bullet == TypeOFBullets.SuperRocket && ship[TypeOfGun.RocketGun] && ship.NumOfSuperRockets < 3)
     {
         ship.NumOfSuperRockets++;
         player.Money -= shop.GetPrice(TypeOFBullets.SuperRocket.ToString());
         return(true);
     }
     else if (bullet == TypeOFBullets.BarrelBurn && ship[TypeOfGun.Catapult] && ship.NumOfFireBarrels < 5)
     {
         ship.NumOfFireBarrels++;
         player.Money -= shop.GetPrice(TypeOFBullets.BarrelBurn.ToString());
         return(true);
     }
     else if (bullet == TypeOFBullets.RottenFish && ship[TypeOfGun.Catapult] && ship.NumOfFishBarrels < 5)
     {
         ship.NumOfFishBarrels++;
         player.Money -= shop.GetPrice(TypeOFBullets.RottenFish.ToString());
         return(true);
     }
     else if (bullet == TypeOFBullets.Bomb && ship[TypeOfGun.CannonGun] && ship.NumOfBombs < 5)
     {
         ship.NumOfBombs++;
         player.Money -= shop.GetPrice(TypeOFBullets.Bomb.ToString());
         return(true);
     }
     return(false);
 }
Exemple #2
0
 public override bool Buy(TypeOFBullets bullet, IShip ship, IPlayer player)
 {
     if (bullet == TypeOFBullets.Kamikaze && ship[TypeOfGun.RocketGun] && ship.NumOfCrazyAlbatroses < 1)
     {
         ship.NumOfCrazyAlbatroses++;
         player.Money -= shop.GetPrice(TypeOFBullets.Kamikaze.ToString());
         return true;
     }
     if (bullet == TypeOFBullets.SuperRocket && ship[TypeOfGun.RocketGun] && ship.NumOfSuperRockets < 3)
     {
         ship.NumOfSuperRockets++;
         player.Money -= shop.GetPrice(TypeOFBullets.SuperRocket.ToString());
         return true;
     }
     else if (bullet == TypeOFBullets.BarrelBurn && ship[TypeOfGun.Catapult] && ship.NumOfFireBarrels < 5)
     {
         ship.NumOfFireBarrels++;
         player.Money -= shop.GetPrice(TypeOFBullets.BarrelBurn.ToString());
         return true;
     }
     else if (bullet == TypeOFBullets.RottenFish && ship[TypeOfGun.Catapult] && ship.NumOfFishBarrels < 5)
     {
         ship.NumOfFishBarrels++;
         player.Money -= shop.GetPrice(TypeOFBullets.RottenFish.ToString());
         return true;
     }
     else if (bullet == TypeOFBullets.Bomb && ship[TypeOfGun.CannonGun] && ship.NumOfBombs < 5)
     {
         ship.NumOfBombs++;
         player.Money -= shop.GetPrice(TypeOFBullets.Bomb.ToString());
         return true;
     }
     return false;
 }
Exemple #3
0
 public override IBullet Fire(TypeOFBullets bulletType)
 {
     IBullet bullet = null;
  
         if (bulletType == TypeOFBullets.Cannonbal)
         {
             bullet = new Cannonball(100, 100);
         }
         else
         {
             bullet = new Bomb(100, 100);
         }
     return bullet;
 }
Exemple #4
0
        public override IBullet Fire(TypeOFBullets bulletType)
        {
            IBullet bullet = null;

            if (bulletType == TypeOFBullets.Cannonbal)
            {
                bullet = new Cannonball(100, 100);
            }
            else
            {
                bullet = new Bomb(100, 100);
            }
            return(bullet);
        }
 public override IBullet Fire(TypeOFBullets bulletType)
 {
     IBullet bullet = null;
         if (bulletType == TypeOFBullets.Rocket)
         {
             bullet = new Rocket(100, 100);
         }
         else if (bulletType == TypeOFBullets.SuperRocket)
         {
             bullet = new SuperRocket(100, 100);
         }
         else
         {
             bullet = new KamikazeSeagull(100, 100);
         }
     return bullet;
 }
Exemple #6
0
 public override IBullet Fire(TypeOFBullets bulletType)
 {
     IBullet bullet = null;
         if (bulletType == TypeOFBullets.Cobblestone)
         {
             bullet = new Cobblestone(100, 100);
         }
         else if (bulletType == TypeOFBullets.BarrelBurn)
         {
             bullet = new BarrelWithBurnMix(100, 100);
         }
         else
         {
             bullet = new BarrelOfRottenFish(100, 100);
         }
     return bullet;
 }
        public override IBullet Fire(TypeOFBullets bulletType)
        {
            IBullet bullet = null;

            if (bulletType == TypeOFBullets.Rocket)
            {
                bullet = new Rocket(100, 100);
            }
            else if (bulletType == TypeOFBullets.SuperRocket)
            {
                bullet = new SuperRocket(100, 100);
            }
            else
            {
                bullet = new KamikazeSeagull(100, 100);
            }
            return(bullet);
        }
Exemple #8
0
 abstract public IBullet Fire(TypeOFBullets bulletType);
 abstract public bool Buy(TypeOFBullets bullet, IShip ship, IPlayer player);
Exemple #10
0
 abstract public IBullet Fire(TypeOFBullets bulletType);
Exemple #11
0
 abstract public bool Buy(TypeOFBullets bullet, IShip ship, IPlayer player);