Changeset 289 for trunk/UGameSystem.pas
- Timestamp:
- Mar 24, 2019, 11:15:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGameSystem.pas
r284 r289 7 7 uses 8 8 Classes, SysUtils, fgl, UUnit, DOM, XMLRead, XMLWrite, UXMLUtils, XMLConf, 9 FileUtil, UMapType, UNation ;9 FileUtil, UMapType, UNation, UBuilding; 10 10 11 11 type … … 23 23 PreferedMapType: TMapType; 24 24 Nations: TNations; 25 BuildingKinds: TBuildingKinds; 25 26 constructor Create; 26 27 destructor Destroy; override; … … 79 80 begin 80 81 UnitKinds := TUnitKinds.Create; 82 BuildingKinds := TBuildingKinds.Create; 81 83 Nations := TNations.Create; 82 84 end; … … 85 87 begin 86 88 Nations.Free; 89 BuildingKinds.Free; 87 90 UnitKinds.Free; 88 91 inherited Destroy; … … 92 95 begin 93 96 UnitKinds.Clear; 97 BuildingKinds.Clear; 94 98 Nations.Clear; 95 99 end; … … 109 113 PreferedMapType := Source.PreferedMapType; 110 114 UnitKinds.Assign(Source.UnitKinds); 115 BuildingKinds.Assign(Source.BuildingKinds); 111 116 Nations.Assign(Source.Nations); 112 117 end; … … 124 129 if Assigned(NewNode) then 125 130 UnitKinds.LoadFromNode(NewNode); 131 NewNode := Node.FindNode('BuildingKinds'); 132 if Assigned(NewNode) then 133 BuildingKinds.LoadFromNode(NewNode); 126 134 NewNode := Node.FindNode('Nations'); 127 135 if Assigned(NewNode) then … … 141 149 Node.AppendChild(NewNode); 142 150 UnitKinds.SaveToNode(NewNode); 151 NewNode := Node.OwnerDocument.CreateElement('BuildingKinds'); 152 Node.AppendChild(NewNode); 153 BuildingKinds.SaveToNode(NewNode); 143 154 NewNode := Node.OwnerDocument.CreateElement('Nations'); 144 155 Node.AppendChild(NewNode);
Note:
See TracChangeset
for help on using the changeset viewer.