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(); }
public void SwallowEatableObject(EatableObject swallowed) { this.Radius = Math.Sqrt(Math.Pow(this.Radius, 2) + Math.Pow(swallowed.Radius, 2)); swallowed.Remove(); }