Changeset 132


Ignore:
Timestamp:
May 2, 2023, 12:09:33 AM (20 months ago)
Author:
chronos
Message:
  • Fixed: Improved stored game state.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UEngine.pas

    r131 r132  
    10141014var
    10151015  Node2: TDOMNode;
     1016  I: Integer;
    10161017begin
    10171018  inherited;
     
    10261027  if Assigned(Node2) then
    10271028    LineStations.LoadFromXmlNode(Node2);
     1029  for I := 0 to LineStations.Count - 1 do
     1030    LineStations[I].MapStation.Lines.Add(Self);
    10281031end;
    10291032
     
    13591362  DestinationIndex := ReadInteger(Node, 'DestinationIndex', Integer(DestinationIndex));
    13601363  IsTerminal := ReadBoolean(Node, 'IsTerminal', IsTerminal);
     1364  OverloadDuration := ReadDateTime(Node, 'OverloadDuration', OverloadDuration);
    13611365
    13621366  Node2 := Node.FindNode(DOMString(TMetroPassengers.GetClassSysName));
     
    13741378  WriteInteger(Node, 'DestinationIndex', DestinationIndex);
    13751379  WriteBoolean(Node, 'IsTerminal', IsTerminal);
     1380  WriteDateTime(Node, 'OverloadDuration', OverloadDuration);
    13761381
    13771382  NewNode := Node.OwnerDocument.CreateElement(DOMString(TMetroPassengers.GetClassSysName));
     
    40394044  City := Cities.SearchBySysName(ReadString(Node, 'CityName', ''));
    40404045  AvailableTerminals := ReadInteger(Node, 'AvailableTerminals', AvailableTerminals);
     4046  LastNewShapeTime := ReadDateTime(Node, 'LastNewShapeTime', LastNewShapeTime);
     4047  LastNewWeekTime := ReadDateTime(Node, 'LastNewWeekTime', LastNewWeekTime);
     4048  LastNewPassengerTime := ReadDateTime(Node, 'LastNewPassengerTime', LastNewPassengerTime);
     4049  LastNewStationTime := ReadDateTime(Node, 'LastNewStationTime', LastNewStationTime);
    40414050
    40424051  NewNode := Node.FindNode(DOMString(TView.GetClassSysName));
     
    40854094  if Assigned(NewNode) then
    40864095    Trains.LoadFromXmlNode(NewNode);
     4096
     4097  ComputeShapeDistance;
    40874098end;
    40884099
     
    41054116  if Assigned(City) then WriteString(Node, 'CityName', City.SysName);
    41064117  WriteInteger(Node, 'AvailableTerminals', AvailableTerminals);
     4118  WriteDateTime(Node, 'LastNewShapeTime', LastNewShapeTime);
     4119  WriteDateTime(Node, 'LastNewWeekTime', LastNewWeekTime);
     4120  WriteDateTime(Node, 'LastNewPassengerTime', LastNewPassengerTime);
     4121  WriteDateTime(Node, 'LastNewStationTime', LastNewStationTime);
    41074122
    41084123  NewNode := Node.OwnerDocument.CreateElement(DOMString(TView.GetClassSysName));
  • trunk/UItems.pas

    r131 r132  
    119119  Node2 := Node.FirstChild;
    120120  while Assigned(Node2) and (Node2.NodeName = DOMString(T.GetClassSysName)) do begin
    121     RefId := StrToInt(string(Node.TextContent));
     121    RefId := StrToInt(string(Node2.TextContent));
    122122    NewItem := Target.FindById(RefId);
    123123    if Assigned(NewItem) then Add(NewItem)
     
    168168  Count := 0;
    169169  Node2 := Node.FirstChild;
    170   while Assigned(Node2) and (Node2.NodeName = UnicodeString(GetItemClass.GetClassSysName)) do begin
     170  while Assigned(Node2) and (Node2.NodeName = UnicodeString(T.GetClassSysName)) do begin
    171171    NewItem := CreateItem;
    172172    NewItem.LoadFromXmlNode(Node2);
     
    183183  for I := 0 to Count - 1 do
    184184  with TItem(Items[I]) do begin
    185     NewNode2 := Node.OwnerDocument.CreateElement(UnicodeString(GetItemClass.GetClassSysName));
     185    NewNode2 := Node.OwnerDocument.CreateElement(UnicodeString(T.GetClassSysName));
    186186    Node.AppendChild(NewNode2);
    187187    SaveToXmlNode(NewNode2);
Note: See TracChangeset for help on using the changeset viewer.