unit patient_impl;
interface
uses SysUtils, classes;
Type
TZustand =
class(TPersistent)
private
FAtem: Integer;
FHerzschlag: Integer;
public
procedure Assign(Source : TPersistent);
override;
// Sollte immer überschrieben werden
published
property Atem : Integer
read FAtem
write FAtem
default 0;
property Herzschlag : Integer
read FHerzschlag
write FHerzschlag
default 0;
end;
TPatient =
class(TCollectionItem)
private
FLaufText :
String;
FName :
String;
FTipps : TStrings;
FStory : TStrings;
FZustand : TZustand;
procedure SetStory(
const Value: TStrings);
procedure SetTipps(
const Value: TStrings);
procedure SetZustand(
const Value: TZustand);
public
constructor Create(Collection : TCollection);
override;
destructor Destroy;
override;
procedure Assign(Source : TPersistent);
override;
// Sollte immer überschrieben werden
published
property Name :
String read FName
write FName;
property LaufText :
String read FLaufText
write FLaufText;
property Story : TStrings
read FStory
write SetStory;
property Tipps : TStrings
read FTipps
write SetTipps;
property Zustand : TZustand
read FZustand
write SetZustand;
end;
implementation
{ TZustand }
procedure TZustand.Assign(Source: TPersistent);
begin
If Source
is TZustand
then
begin
FAtem:=TZustand(Source).Atem;
FHerzschlag:=TZustand(Source).Herzschlag;
end;
inherited Assign(Source);
end;
{ TPatient }
procedure TPatient.Assign(Source: TPersistent);
begin
If Source
is TPatient
then
begin
FLaufText:=TPatient(Source).LaufText;
FName:=TPatient(Source).
Name;
FTipps.Assign(TPatient(Source).Tipps);
FStory.Assign(TPatient(Source).Story);
FZustand.Assign(TPatient(Source).Zustand);
end;
inherited Assign(Source);
end;
constructor TPatient.Create(Collection: TCollection);
begin
inherited Create(Collection);
FZustand:=TZustand.Create;
FTipps:=TStringList.Create;
FStory:=TStringList.Create;
end;
destructor TPatient.Destroy;
begin
FStory.Free;
FTipps.Free;
FZustand.Free;
inherited Destroy;
end;
procedure TPatient.SetStory(
const Value: TStrings);
begin
FStory.Assign(Value);
end;
procedure TPatient.SetTipps(
const Value: TStrings);
begin
FTipps.Assign(Value);
end;
procedure TPatient.SetZustand(
const Value: TZustand);
begin
FZustand.Assign(Value);
end;
end.