Changeset 229 for trunk/UGame.pas
- Timestamp:
- Sep 18, 2018, 6:11:18 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r224 r229 456 456 VoidPercentage: Integer; 457 457 SymetricMap: Boolean; 458 CyclicMap: Boolean; 458 459 GrowCells: TGrowCells; 459 460 GrowAmount: TGrowAmount; … … 1613 1614 function TMap.IsValidIndex(Index: TPoint): Boolean; 1614 1615 begin 1615 Result := False; 1616 Result := (Index.X >= 0) and (Index.X < Size.X) and 1617 (Index.Y >= 0) and (Index.Y < Size.Y); 1616 1618 end; 1617 1619 … … 2085 2087 procedure TCell.ConnectTo(Cell: TCell); 2086 2088 begin 2087 Cell.Neighbors.Add(Self); 2088 Neighbors.Add(Cell); 2089 // Connect only if already not connected 2090 if Neighbors.IndexOf(Cell) < 0 then begin 2091 Cell.Neighbors.Add(Self); 2092 Neighbors.Add(Cell); 2093 end; 2089 2094 end; 2090 2095 … … 3136 3141 VoidPercentage := Source.VoidPercentage; 3137 3142 SymetricMap := Source.SymetricMap; 3143 CyclicMap := Source.CyclicMap; 3138 3144 GrowCells := Source.GrowCells; 3139 3145 GrowAmount := Source.GrowAmount; … … 3157 3163 SetValue(DOMString(Path + '/MapImage'), DOMString(MapImageFileName)); 3158 3164 SetValue(DOMString(Path + '/SymetricMap'), SymetricMap); 3165 SetValue(DOMString(Path + '/CyclicMap'), CyclicMap); 3159 3166 SetValue(DOMString(Path + '/FogOfWar'), FogOfWar); 3160 3167 SetValue(DOMString(Path + '/VoidEnabled'), VoidEnabled); … … 3185 3192 MapImageFileName := string(GetValue(DOMString(Path + '/MapImage'), DOMString(MapImageFileName))); 3186 3193 SymetricMap := GetValue(DOMString(Path + '/SymetricMap'), False); 3194 CyclicMap := GetValue(DOMString(Path + '/CyclicMap'), False); 3187 3195 FogOfWar := GetValue(DOMString(Path + '/FogOfWar'), False); 3188 3196 VoidEnabled := GetValue(DOMString(Path + '/VoidEnabled'), True); … … 3225 3233 with RootNode do begin 3226 3234 SymetricMap := ReadBoolean(RootNode, 'SymetricMap', False); 3235 CyclicMap := ReadBoolean(RootNode, 'CyclicMap', False); 3227 3236 FogOfWar := ReadBoolean(RootNode, 'FogOfWar', False); 3228 3237 VoidEnabled := ReadBoolean(RootNode, 'VoidEnabled', False); … … 3276 3285 with RootNode do begin 3277 3286 WriteBoolean(RootNode, 'SymetricMap', SymetricMap); 3287 WriteBoolean(RootNode, 'CyclicMap', CyclicMap); 3278 3288 WriteBoolean(RootNode, 'FogOfWar', FogOfWar); 3279 3289 WriteBoolean(RootNode, 'VoidEnabled', VoidEnabled); … … 3478 3488 TurnCounter := 1; 3479 3489 3490 Map.Cyclic := CyclicMap; 3480 3491 Map.Generate; 3481 3492 Map.MaxPower := MaxPower;
Note:
See TracChangeset
for help on using the changeset viewer.