Introduction to OOP Chapter 7: A Billiards Game: next previous audio real text

Graphical Object Class

Every graphical object has a link field and a region of space.


TWall = class(TObject)
public
	constructor create 
		(ix, iy, iw, ih : Integer; cf : Real; ilink : TWall);
	procedure draw (canvas : TCanvas);
	function hasIntersected(aBall : Tball) : Boolean;
	procedure hitBy (aBall : TBall);
private
	x, y : Integer;
	height, width : Integer;
	convertFactor : Real;
	link : TWall;
end;

Intro OOP, Chapter 7, Slide 3