Введение в программирование. Pascal и Delphi. Гурьянов Л.В - 171 стр.

UptoLike

170
procedure Location.Create(InitX, InitY : integer);
begin
x := InitX;
y := InitY;
end;
function Location.GetX : integer;
begin
GetX := x;
end;
function Location.GetY : integer;
begin
GetY := y;
end;
{Реализация методов класса Point}
constructor Point.Create(InitX, InitY: integer);
begin
Location.Create(InitX, InitY);
Visible := false;
end;
destructor Point.Destroy;
begin
Hide;
end;
procedure Point.Show;
begin
Visible := true;
PutPixel(x, y, GetColor);
end;
procedure Point.Hide;
begin
Visible := false;
PutPixel(x, y, GetBkColor);
end;
procedure Location.Create(InitX, InitY : integer);
begin
  x := InitX;
  y := InitY;
end;
function Location.GetX : integer;
begin
  GetX := x;
end;

function Location.GetY : integer;
begin
  GetY := y;
end;
{Реализация методов класса Point}
constructor Point.Create(InitX, InitY: integer);
begin
  Location.Create(InitX, InitY);
  Visible := false;
end;
destructor Point.Destroy;
begin
  Hide;
end;
procedure Point.Show;
begin
  Visible := true;
  PutPixel(x, y, GetColor);
end;
procedure Point.Hide;
begin
  Visible := false;
  PutPixel(x, y, GetBkColor);
end;


                             170