Changeset 247
- Timestamp:
- Sep 22, 2018, 1:27:09 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.pas
r243 r247 566 566 CityEnabled := CheckBoxCity.Checked; 567 567 CityPercentage := SpinEditCityPercent.Value; 568 Map.Cyclic := CyclicMap; 568 569 Map.Size := TPoint.Create(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value); 569 570 GrowAmount := TGrowAmount(RadioGroupGrowAmount.ItemIndex); -
trunk/UMap.pas
r244 r247 134 134 TMap = class 135 135 private 136 FSize: TPoint;137 136 function GetPixelRect: TRect; 138 137 function GetSize: TPoint; virtual; 139 138 function SearchDifferentCellArea(List: TCells; SourceArea, 140 139 DestArea: TMapArea): TCell; 141 procedure SetSize(AValue: TPoint); virtual;142 140 protected 141 FSize: TPoint; 143 142 FPixelRect: TRect; 144 143 FNewCellId: Integer; 145 144 function GetNewCellId: Integer; virtual; 146 145 procedure SortNeighborsByAngle; 146 procedure SetSize(AValue: TPoint); virtual; 147 147 public 148 148 Game: TObject; //TGame; … … 563 563 // Do not assign Game field 564 564 MaxPower := Source.MaxPower; 565 Cyclic := Source.Cyclic; 565 566 Size := Source.Size; 566 567 DefaultCellSize := Source.DefaultCellSize; 567 568 Shape := Source.Shape; 568 569 Image.Picture.Bitmap.Assign(Source.Image.Picture.Bitmap); 569 Cyclic := Source.Cyclic;570 570 571 571 // TODO: How to copy cells -
trunk/UMapType.pas
r242 r247 25 25 procedure GetCellPosNeighbors(CellPos: TPoint; Cell: TCell); 26 26 function GetHexagonPolygon(Pos: TPoint; Size: TPoint): TPolygon; 27 protected 28 procedure SetSize(AValue: TPoint); override; 27 29 public 28 30 function CalculatePixelRect: TRect; override; … … 53 55 CellMulY = 1.05; 54 56 function GetTrianglePolygon(Pos: TPoint; Size: TPoint; Reverse: Boolean): TPolygon; 57 protected 58 procedure SetSize(AValue: TPoint); override; 55 59 public 56 60 procedure Generate; override; … … 75 79 CellMulY = 3.35; 76 80 function GetTilePolygon(Pos: TPoint; Size: TPoint): TPolygon; 81 protected 82 procedure SetSize(AValue: TPoint); override; 77 83 public 78 84 procedure Generate; override; … … 92 98 Result.Points[2] := TPoint.Create(Pos.X, Trunc(Pos.Y + Size.Y / 3.5)); 93 99 Result.Points[3] := TPoint.Create(Trunc(Pos.X - Size.X / 2), Pos.Y); 100 end; 101 102 procedure TIsometricMap.SetSize(AValue: TPoint); 103 begin 104 inherited; 105 if Cyclic then 106 FSize := TPoint.Create(FSize.X, FSize.Y + FSize.Y mod 2); 94 107 end; 95 108 … … 181 194 Result.Points[4] := TPoint.Create(Trunc(Pos.X - Shift.X * Size.X), Trunc(Pos.Y + Shift.Y * Size.Y)); 182 195 Result.Points[5] := TPoint.Create(Trunc(Pos.X - Shift.X * Size.X), Trunc(Pos.Y - Shift.Y * Size.Y)); 196 end; 197 198 procedure THexMap.SetSize(AValue: TPoint); 199 begin 200 inherited; 201 if Cyclic then 202 FSize := TPoint.Create(FSize.X, FSize.Y + FSize.Y mod 2); 183 203 end; 184 204 … … 478 498 end; 479 499 500 procedure TTriangleMap.SetSize(AValue: TPoint); 501 begin 502 inherited; 503 if Cyclic then 504 FSize := TPoint.Create(FSize.X + FSize.X mod 2, FSize.Y + FSize.Y mod 2); 505 end; 506 480 507 procedure TTriangleMap.Generate; 481 508 var
Note:
See TracChangeset
for help on using the changeset viewer.