📄 sightingu.pas
字号:
unit SightingU;
interface
type
TSighting = class(TObject)
private
FGrid: string;
FNumber: integer;
FSightType: string;
public
property Grid: string read FGrid; // Immutable properties
property Number: integer read FNumber; // no of individuals
property SightType: string read FSightType;
constructor Create (AGrid: string; ANumber: integer);
end; // end TSighting = class(TObject)
TTreeSighting = class(TSighting)
public
constructor Create (AGrid: string; ANumber: integer;
ASightType: string); // maintain immutability
end; // end TTreeSighting = class(TSighting)
TBirdSighting = class(TSighting)
private
FBreeding: boolean;
FSightDate: string;
public
property Breeding: boolean read FBreeding;
property SightDate: string read FSightDate;
constructor Create (AGrid: string;
ANumber: integer; ASightType: string;
ABreeding: boolean; ASightDate: string);
end; // end TBirdSighting = class(TSighting)
implementation
{ TSighting }
constructor TSighting.Create(AGrid: string;
ANumber: integer);
begin
FGrid := AGrid;
FNumber := ANumber;
FSightType := 'Unknown';
end; // end constructor TSighting.Create
{ TBirdSighting }
constructor TBirdSighting.Create(AGrid: string;
ANumber: integer; ASightType: string;
ABreeding: boolean; ASightDate: string);
begin
inherited Create (AGrid, ANumber);
FSightType := ASightType; // Generalise up?
FBreeding := ABreeding;
FSightDate := ASightDate;
end; // end constructor TBirdSighting
{ TTreeSighting }
constructor TTreeSighting.Create(AGrid: string;
ANumber: integer; ASightType: string);
begin
inherited Create (AGrid, ANumber);
FSightType := ASightType; // Generalise up?
end; // end constructor TTreeSighting
end. // end SightingU
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -