Advertisement
MadCortez

Untitled

May 21st, 2021
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.16 KB | None | 0 0
  1. unit UnitMain;
  2.  
  3. interface
  4.  
  5. Uses
  6.    Classes, SysUtils, Graphics;
  7.  
  8. Type
  9.    TBase = class
  10.      private
  11.       x, y: Integer;
  12.       bitmap: TBitmap;
  13.      public
  14.       Constructor Create(x0, y0: Integer; bitmap0: TBitmap);
  15.  
  16.       procedure SetX(x0: Integer);
  17.       procedure SetY(y0: Integer);
  18.       procedure SetBitmap(bitmap0: TBitmap);
  19.  
  20.       function GetX: Integer;
  21.       function GetY: Integer;
  22.       function GetBitmap: TBitmap;
  23.    end;
  24.  
  25.    TApple = class(TBase)
  26.  
  27.    end;
  28.  
  29.    THead = class(TBase)
  30.  
  31.    end;
  32.  
  33.    TTail = class(TBase)
  34.  
  35.    end;
  36.  
  37.    TBox = class(TBase)
  38.  
  39.    end;
  40.  
  41. implementation
  42.  
  43. { TBase }
  44.  
  45. constructor TBase.Create(x0, y0: Integer; bitmap0: TBitmap);
  46. begin
  47.    x := x0;
  48.    y := y0;
  49.    bitmap := bitmap0;
  50. end;
  51.  
  52. function TBase.GetBitmap: TBitmap;
  53. begin
  54.    Result := bitmap;
  55. end;
  56.  
  57. function TBase.GetX: Integer;
  58. begin
  59.    Result := x;
  60. end;
  61.  
  62. function TBase.GetY: Integer;
  63. begin
  64.    Result := y;
  65. end;
  66.  
  67. procedure TBase.SetBitmap(bitmap0: TBitmap);
  68. begin
  69.    bitmap := bitmap0;
  70. end;
  71.  
  72. procedure TBase.SetX(x0: Integer);
  73. begin
  74.    x := x0;
  75. end;
  76.  
  77. procedure TBase.SetY(y0: Integer);
  78. begin
  79.    y := y0;
  80. end;
  81.  
  82. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement