Beispiel #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);
 }
Beispiel #2
0
 public SquarePegAdapter(SquarePeg peg) : base(peg.GetWidth())
 {
     this.peg = peg;
 }