private EnemyShip selectFiringShip(int amountOfShipsToFire, List <EnemyShip> firingShips) { var firingShipIndex = RandomUtil.GetNextRandomFromMax(amountOfShipsToFire); var firingShip = firingShips[firingShipIndex]; return(firingShip); }
private void fireMultipleShips(List <EnemyShip> firingShips) { var amountOfShipsToFire = RandomUtil.GetNextRandomFromMax(firingShips.Count()); for (var i = 0; i < amountOfShipsToFire; i++) { var firingShip = this.selectFiringShip(amountOfShipsToFire, firingShips); this.fireShipWhenShipHasNotFired(firingShip); } }
private void addBonusEnemyToGame() { var randomInt = RandomUtil.GetNextRandomFromMax(30); if (this.bonusEnemyShip == null) { this.bonusEnemyShip = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.BonusShip); this.currentBackground.Children.Add(this.bonusEnemyShip.Sprite); this.placeBonusEnemyShip(); } }