Introduction to OOP | Chapter 9: A Solitare Game: | next | previous | audio | real | text |
public class WinFormsCardView : CardView { public WinFormsCardView (Graphics aGraphicsObject) { g = aGraphicsObject; } public override void display (PlayingCard aCard,int x,int y) { if (aCard == null) { Pen myPen = new Pen(Color.Black,2); Brush myBrush = new SolidBrush (Color.White); g.FillRectangle(myBrush,x,y,CardView.Width,CardView.Height); g.DrawRectangle(myPen,x,y,CardView.Width,CardView.Height); } else { paintCard (aCard,x,y); } } private void paintCard (PlayingCard aCard,int x,int y) { ... } }