So, ich habe das Tool jetzt schon einmal erfolgreich für mich eingesetzt
Hier gibt es mal ein
Demovideo.
17 Min, wovon einiges für die grundsätzliche Erklärung meiner eigentlichen Komponenten drauf geht.
Die von mir gezeigten Komponenten und der Aufbau der Units sind jedoch dabei eher nebensächlich, da in den Musterdateien auch ganz andere Strukturen definiert werden können.
In meinem Fall werden z.B. aus
Code:
!Game
>xc_.txt
>xc.txt
>
xml.txt
Name: String
Number: Integer
GameType: TGameType
GamePartyId1: String
GamePartyId2: String
WinnerId: String
LoserId: String
drei Units erstellt, u.a. folgende:
Delphi-Quellcode:
unit xcGame_;
interface
uses
Classes, xcOlympic, txmlOlympic;
type
TxcGame_ =
class(TxcOlympic)
private
function GetName:
String;
procedure SetName(
const Value:
String);
function GetNumber: Integer;
procedure SetNumber(
const Value: Integer);
function GetGameType: TGameType;
procedure SetGameType(
const Value: TGameType);
function GetGamePartyId1:
String;
procedure SetGamePartyId1(
const Value:
String);
function GetGamePartyId2:
String;
procedure SetGamePartyId2(
const Value:
String);
function GetWinnerId:
String;
procedure SetWinnerId(
const Value:
String);
function GetLoserId:
String;
procedure SetLoserId(
const Value:
String);
protected
public
procedure Clear;
override;
procedure Make;
override;
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
property Name:
String read GetName
write SetName;
property Number: Integer
read GetNumber
write SetNumber;
property GameType: TGameType
read GetGameType
write SetGameType;
property GamePartyId1:
String read GetGamePartyId1
write SetGamePartyId1;
property GamePartyId2:
String read GetGamePartyId2
write SetGamePartyId2;
property WinnerId:
String read GetWinnerId
write SetWinnerId;
property LoserId:
String read GetLoserId
write SetLoserId;
published
end;
implementation
{ TxcGame_ }
constructor TxcGame_.Create(AOwner: TComponent);
begin
inherited;
NodeName := '
Game';
end;
destructor TxcGame_.Destroy;
begin
inherited;
end;
procedure TxcGame_.Clear;
begin
inherited;
Name := '
';
Number := 0;
GameType := gtNone;
GamePartyId1 := '
';
GamePartyId2 := '
';
WinnerId := '
';
LoserId := '
';
end;
procedure TxcGame_.Make;
begin
inherited;
GetNode('
Name');
GetNode('
Number');
GetNode('
GameType');
GetNode('
GamePartyId1');
GetNode('
GamePartyId2');
GetNode('
WinnerId');
GetNode('
LoserId');
end;
// TxcGame_.Name
function TxcGame_.GetName:
String;
begin
Result := ReadString('
Name');
end;
procedure TxcGame_.SetName(
const Value:
String);
begin
WriteString('
Name', Value);
end;
// TxcGame_.Number
function TxcGame_.GetNumber: Integer;
begin
Result := ReadInteger('
Number');
end;
procedure TxcGame_.SetNumber(
const Value: Integer);
begin
WriteInteger('
Number', Value);
end;
// TxcGame_.GameType
function TxcGame_.GetGameType: TGameType;
begin
Result := ReadGameType('
GameType');
end;
procedure TxcGame_.SetGameType(
const Value: TGameType);
begin
WriteGameType('
GameType', Value);
end;
// TxcGame_.GamePartyId1
function TxcGame_.GetGamePartyId1:
String;
begin
Result := ReadString('
GamePartyId1');
end;
procedure TxcGame_.SetGamePartyId1(
const Value:
String);
begin
WriteString('
GamePartyId1', Value);
end;
// TxcGame_.GamePartyId2
function TxcGame_.GetGamePartyId2:
String;
begin
Result := ReadString('
GamePartyId2');
end;
procedure TxcGame_.SetGamePartyId2(
const Value:
String);
begin
WriteString('
GamePartyId2', Value);
end;
// TxcGame_.WinnerId
function TxcGame_.GetWinnerId:
String;
begin
Result := ReadString('
WinnerId');
end;
procedure TxcGame_.SetWinnerId(
const Value:
String);
begin
WriteString('
WinnerId', Value);
end;
// TxcGame_.LoserId
function TxcGame_.GetLoserId:
String;
begin
Result := ReadString('
LoserId');
end;
procedure TxcGame_.SetLoserId(
const Value:
String);
begin
WriteString('
LoserId', Value);
end;
end.
So kann man also sehr schnell neue Klassen erstellen lassen oder bestehenden Klassen neue/geänderte Eigenschaften hinzufügen.
Wenn Interesse besteht lasse ich mit mir reden