generated from emilybache/GildedRose-Refactoring-Kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.pas
39 lines (31 loc) · 769 Bytes
/
Item.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
unit Item;
interface
type
TItem = class(TObject)
private
FName: string;
FSellIn: Integer;
FQuality: Integer;
public
constructor Create(const AName: string; const ASellIn, AQuality: Integer);
function ToString: string; override;
property Name: string read FName write FName;
property SellIn: Integer read FSellIn write FSellIn;
property Quality: Integer read FQuality write FQuality;
end;
implementation
uses
System.SysUtils;
{ TItem }
constructor TItem.Create(const AName: string; const ASellIn, AQuality: Integer);
begin
inherited Create;
FName := AName;
FSellIn := ASellIn;
FQuality := AQuality;
end;
function TItem.ToString: string;
begin
Result := Format('%s, %d, %d', [Name, SellIn, Quality]);
end;
end.