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

UptoLike

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

20
function TTracedSprite.Move(const drift:Types.TSize):Boolean;
begin
if FVisible and FTraced then PutTrace;
Result:=inherited Move(drift);
if Result then
FCenter:=Types.CenterPoint(SpriteRect)
end {TTracedSprite.Move};
procedure TTracedSprite.PutTrace;
var i:integer;
begin
with FCenter do
begin
for i:=FSpriteList.FCount-1 downto 0 do
begin
with FSpriteList[i] do
if FVisible and Types.PtInRect(SpriteRect,Self.FCenter)
then Restore;
end;
with TTracedSpriteList(FSpriteList),FClientRect do
if not TraceMap[x-Left,y-Top] then
begin
with FCanvas do
if FTraceColored then Pixels[x,y]:=FTraceColor else
Pixels[x,y]:=$ffffff xor Pixels[x,y];
TraceMap[x-Left,y-Top]:=true;
SetLength(FTracePoints,High(FTracePoints)+2);
FTracePoints[High(FTracePoints)].X:=x;FTracePoints[High(FTracePoints)].Y:=y;
end;
for i:=0 to FSpriteList.FCount-1 do
begin
with FSpriteList[i] do
if FVisible and Types.PtInRect(SpriteRect,Self.FCenter)
then Paint;
end
end
end {PutTrace};
//Реализация методов класса TEllipseSprite
procedure TEllipseSprite.AfterConstruction;
begin
inherited;
FColor:=DefaultColor;
end {TEllipseSprite.AfterConstruction};