Пример #1
0
 public double GetRadius()
 {
     // The adapter pretends that it's a round peg with a
     // radius that could fit the square pet that the adapter
     // actually wraps
     return(peg.GetWidth() * Math.Sqrt(2) / 2);
 }
Пример #2
0
 public SquarePegAdapter(SquarePeg peg) : base(peg.GetWidth())
 {
     this.peg = peg;
 }