/// <summary> /// Inserts any <see cref="IRoundPeg"/> implementation into the hole. /// </summary> public void Insert(IRoundPeg peg) { if (peg.Radius > this.Radius) { throw new Exception(message: "You cannot insert an object with larger radius than the hole!"); } Console.WriteLine($"You have inserted a peg with radius {peg.Radius} into the hole successfully."); }
public bool Fits(IRoundPeg roundPeg) { if (radius > roundPeg.GetRadius()) { return(true); } else { return(false); } }
public bool fits(IRoundPeg peg) { return(fits(peg.getRadius())); }
public bool Fits(IRoundPeg roundPeg) { return(roundPeg.Radius <= Radius); }
static bool IsHoleFit(IRoundPeg roundPeg) { int holeRadius = 4; return(roundPeg.GetRadius() <= holeRadius); }