public void Inghitire(RegularBall ball) { if (this.Raza > ball.Raza) { ball.Exista = false; raza += ball.Raza; } else { this.Exista = false; ball.Raza += raza; } }
static void Main(string[] args) { List <Ball> listaBile = new List <Ball>(); Console.Write("Introduceti numarul de Repelent Balls. "); int numarBileRepelent = int.Parse(Console.ReadLine()); List <RepelentBall> listaBileRepelant = new List <RepelentBall>(); for (int i = 0; i < numarBileRepelent; i++) { RepelentBall rp = new RepelentBall(); listaBileRepelant.Add(rp); listaBile.Add(rp); } Console.Write("Introduceti numarul de Regular Balls. "); int numarBileRegular = int.Parse(Console.ReadLine()); List <RegularBall> listaBileRegular = new List <RegularBall>(); for (int i = 0; i < numarBileRegular; i++) { RegularBall rb = new RegularBall(); listaBileRegular.Add(rb); listaBile.Add(rb); } Console.Write("Introduceti numarul de Monster Balls. "); int numarBileMonster = int.Parse(Console.ReadLine()); List <MonsterBall> listaBileMonster = new List <MonsterBall>(); for (int i = 0; i < numarBileMonster; i++) { MonsterBall mb = new MonsterBall(); listaBileMonster.Add(mb); listaBile.Add(mb); } Engine.Start(listaBile); }
public void Inghitire(RegularBall ball) { ball.Exista = false; raza += ball.Raza; }
public void Inghitire(RegularBall ball) { ball.VitezaX *= -1; ball.VitezaY *= -1; }