Open eugeneloza opened 6 years ago
see also #235
The expected architecture is:
TSomeModule = class(TDataModule)
name: string; //e.g. if this is a header (content of the data is strings in this case)
shortname: string;
comment: string;
isChanged: boolean;
procedure WriteModule; override; //override abstract parent
procedure ReadModule; override; //and thrown as a @link to write routine
end;
type TSomeData = class(TDataContainer)
Header: TSomeHeaderModule;
SomeModule1: TSomeModule1;
SomeModule2: TSomeModule2;
procedure WriteData; //architecture for writing
procedure ReadData; //architecture for reading
procedure ConstructInterface; //which will make a tab for edit
procedure ProcessInterface; //which will compare tab's content onchange and will save changes to data
end;
Would require some major architecture changes in Constructor (and a bit in the game). But after all the hard work - it'll become much more convenient/easier/bug-proof to work further.
Merge this with file read/write? #235 #236 - YES
I really don't like the idea. While much better than nothing, it's still too complex to work with. Requires hell of a work to add a simple editor interface (yes, I hate making interfaces :)) just for a single module. And it doesn't look like it'll become easier in future. Taking a month just to make a child of TStringGrid
is a horrible waste of time.
Thinking on using modular design like in previous version of the constructor. Looks like I should stick to it where it's needed. Would require some redesign of the architecture, but doesn't look too complex