Example #1
0
        public void EatObject(EatableObject other)
        {
            if (other == null)
            {
                return;
            }

            OnCircleAte?.Invoke(this, new CircleAteEventArgs(this));

            this.Radius = Math.Sqrt(Math.Pow(this.Radius, 2) + Math.Pow(other.Radius, 2));

            other.Remove();
        }
Example #2
0
 public void SwallowEatableObject(EatableObject swallowed)
 {
     this.Radius = Math.Sqrt(Math.Pow(this.Radius, 2) + Math.Pow(swallowed.Radius, 2));
     swallowed.Remove();
 }