Changeset 294 for trunk/UGame.pas
- Timestamp:
- Mar 29, 2019, 8:40:42 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r291 r294 7 7 uses 8 8 Classes, SysUtils, ExtCtrls, Graphics, XMLConf, XMLRead, XMLWrite, Forms, 9 DOM, Math, LazFileUtils, UXMLUtils, Dialogs, LCLType, LCLIntf, fgl, 9 DOM, Math, LazFileUtils, UXMLUtils, Dialogs, LCLType, LCLIntf, fgl, UBuilding, 10 10 UGeometry, UPlayer, UMap, UMapType, UUnit, UGameSystem; 11 11 … … 64 64 Players: TPlayers; 65 65 Units: TUnits; 66 Buildings: TBuildings; 66 67 Map: TMap; 67 68 MapImageFileName: string; … … 315 316 for Cell in Map.Cells do 316 317 with Cell do begin 317 if (Terrain = ttNormal) and CityEnabled and (Random < CityPercentage / 100) then 318 Terrain := ttCity; 318 if (Terrain = ttNormal) and CityEnabled and (Random < CityPercentage / 100) then begin 319 Building := TBuilding(Buildings.AddItem('City')); 320 Building.Kind := TBuildingKind(GameSystem.BuildingKinds.FindBySpecialType(stCity)); 321 end; 319 322 end; 320 323 end; … … 341 344 StartCell := Map.Cells[Map.Cells.Count - 1 - Map.Cells.IndexOf(Players[0].StartCell)]; 342 345 343 if CityEnabled then StartCell.Terrain := ttCity; 346 if CityEnabled then begin 347 StartCell.Building := TBuilding(Buildings.AddItem('City')); 348 StartCell.Building.Kind := TBuildingKind(GameSystem.BuildingKinds.FindBySpecialType(stCity)); 349 end; 344 350 StartCell.Player := Player; 345 351 if not Assigned(StartCell.OneUnit) then … … 855 861 Units := TUnits.Create; 856 862 Units.Game := Self; 863 Buildings := TBuildings.Create; 864 Buildings.Game := Self; 857 865 Map := TMap.Create; 858 866 Map.Game := Self; … … 878 886 FreeAndNil(Players); 879 887 FreeAndNil(Map); 888 FreeAndNil(Buildings); 880 889 FreeAndNil(Units); 881 890 inherited Destroy;
Note:
See TracChangeset
for help on using the changeset viewer.