Changeset 343
Legend:
- Unmodified
- Added
- Removed
-
trunk/Map.pas
r342 r343 177 177 procedure Clear; 178 178 procedure CheckCells; 179 function ToString: string; override; 179 180 constructor Create; virtual; 180 181 destructor Destroy; override; … … 428 429 Result := ''; 429 430 for C in Self do 430 Result := Result + IntToStr(C.Id) + ', ';431 Result := Result + C.ToString + LineEnding; 431 432 end; 432 433 … … 759 760 end; 760 761 762 function TMap.ToString: string; 763 begin 764 Result := 'MaxPower: ' + IntToStr(MaxPower) + LineEnding; 765 Result := Result + 'Cyclic: ' + BoolToStr(Cyclic) + LineEnding; 766 Result := Result + 'Size: ' + IntToStr(Size.X) + 'x' + IntToStr(Size.Y) + LineEnding; 767 Result := Result + 'DefaultCellSize: ' + IntToStr(DefaultCellSize.X) + 'x' + IntToStr(DefaultCellSize.Y) + LineEnding; 768 Result := Result + 'Shape: ' + IntToStr(Integer(Shape)) + LineEnding; 769 Result := Result + Cells.ToString + LineEnding; 770 end; 771 761 772 constructor TMap.Create; 762 773 begin … … 1100 1111 Player := Source.Player; 1101 1112 Mark := Source.Mark; 1113 Extra := Source.Extra; 1102 1114 // TODO: How to copy neighbours and moves list 1103 1115 end; … … 1111 1123 function TCell.ToString: ansistring; 1112 1124 begin 1113 Result := IntToStr(Id); 1125 Result := 'Id: ' + IntToStr(Id) + LineEnding; 1126 Result := Result + 'PosPx: ' + IntToStr(PosPx.X) + 'x' + IntToStr(PosPx.Y) + LineEnding; 1127 Result := Result + 'Terrain: ' + IntToStr(Integer(Terrain)) + LineEnding; 1128 Result := Result + 'Extra: ' + IntToStr(Integer(Extra)) + LineEnding; 1129 //Result := Result + 'Polygon: ' + IntToStr(Polygon) + LineEnding; 1130 if Assigned(Player) then 1131 Result := Result + 'Player: ' + IntToStr(TPlayer(Player).Id) + LineEnding; 1132 Result := Result + 'Mark:' + BoolToStr(Mark) + LineEnding; 1133 if Assigned(OneUnit) then 1134 Result := Result + 'OneUnit:' + IntToStr(OneUnit.Id) + LineEnding; 1114 1135 end; 1115 1136 -
trunk/Tests.pas
r342 r343 50 50 const 51 51 FileName = 'Test.xtg'; 52 Size = 10; 52 53 var 53 54 Game2: TGame; 54 55 begin 56 Game.Map.Size := TPoint.Create(Size, Size); 57 Game.MapType := mtSquare; 58 Game.New; 55 59 Game.SaveToFile(FileName); 56 60 Game2 := TGame.Create;
Note:
See TracChangeset
for help on using the changeset viewer.