예제 #1
0
 public void Inghitire(RegularBall ball)
 {
     if (this.Raza > ball.Raza)
     {
         ball.Exista = false;
         raza       += ball.Raza;
     }
     else
     {
         this.Exista = false;
         ball.Raza  += raza;
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
 public void Inghitire(RegularBall ball)
 {
     ball.Exista = false;
     raza       += ball.Raza;
 }
예제 #4
0
 public void Inghitire(RegularBall ball)
 {
     ball.VitezaX *= -1;
     ball.VitezaY *= -1;
 }