Changeset 292 for trunk/UGameSystem.pas
- Timestamp:
- Mar 28, 2019, 5:34:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGameSystem.pas
r289 r292 7 7 uses 8 8 Classes, SysUtils, fgl, UUnit, DOM, XMLRead, XMLWrite, UXMLUtils, XMLConf, 9 FileUtil, UMapType, UNation, UBuilding;9 FileUtil, LazFileUtils, UMapType, UNation, UBuilding; 10 10 11 11 type … … 42 42 function AddNew(Name: string): TGameSystem; 43 43 function SearchByName(Name: string): TGameSystem; 44 procedure LoadFromDir(Dir: string); 44 45 end; 45 46 … … 73 74 if I < Count then Result := Items[I] 74 75 else Result := nil; 76 end; 77 78 procedure TGameSystems.LoadFromDir(Dir: string); 79 var 80 Files: TStringList; 81 I: Integer; 82 NewItem: TGameSystem; 83 begin 84 Files := TStringList.Create; 85 FindAllFiles(Files, Dir, '*' + GameSystemExt, True, faAnyFile); 86 for I := 0 to Files.Count - 1 do begin 87 NewItem := TGameSystem.Create; 88 NewItem.LoadFromFile(Files[I]); 89 Add(NewItem); 90 end; 91 Files.Free; 75 92 end; 76 93
Note:
See TracChangeset
for help on using the changeset viewer.