Сравнительное объектно-ориентированное проектирование - 16 стр.

UptoLike

Составители: 

16
end {TSpriteList.Clear};
//Реализация методов класса TSprite
constructor TSprite.Create(const SpriteRect:Types.TRect;const Sprites:TSpriteList);
begin
inherited Create;
FZ:=-1;
FSpriteList:=Sprites;
FLocation:=SpriteRect.TopLeft;
with FSize,SpriteRect do
begin
cx:=Right-Left;cy:=Bottom-Top
end;
end {TSprite.Create};
procedure TSprite.AfterConstruction;
begin
inherited;
FImage:=Graphics.TBitmap.Create;
FImage.Height:=FSize.cy;
FImage.Width:=FSize.cx;
end {TSprite.AfterConstruction};
procedure TSprite.BeforeDestruction;
begin
FImage.Free;
inherited
end {TSprite.BeforeDestruction};
procedure TSprite.SetVisible(const aVisible:Boolean);
begin
if aVisible<>FVisible then
begin
if aVisible then
begin
BeginPaint;
Paint;
EndPaint;
end else
begin
BeginPaint;
Restore;
EndPaint;
end
;
FVisible:=aVisible
end
end {SetVisible};