mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-17 11:25:04 +00:00
Add Delphi port
This commit is contained in:
1 parent
5c7636e4c7
commit
28c2909e3f
12 files changed
+2389
No files matched your search
@@ -0,0 +1,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.
|
||||
Reference in new issue
Block a user