Introduction to OOP Chapter 9: A Solitare Game: next previous audio real text

The CardView is Eventually Implemented

The abstract class CardView will eventually be matched with an implementation. This implementation can encapsulate information about the specific graphics operations of the system.
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) {
		...
	}
}
Intro OOP, Chapter 9, Slide 05