Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (!(obj is ICA4Ball))
            {
                return(false);
            }

            ICA4Ball copy = (ICA4Ball)obj;

            return(GetDisplacement(bPosition, copy.bPosition) < (_radius + copy._radius));
        }
Ejemplo n.º 2
0
        private void AddBalls(PointF pos, string leftRight)
        {
            PointF   direction = new PointF((float)_rnd.Next(-5000, 5001) / 1000, (float)_rnd.Next(-5000, 5001) / 1000);
            int      diameter  = _rnd.Next(20, 51);
            ICA4Ball newBall   = new ICA4Ball(pos, direction, diameter / 2);

            if (leftRight == "Left")
            {
                leftBalls.Add(newBall);
            }
            else
            {
                rightBalls.Add(newBall);
            }
        }