Changeset 342 for trunk/GameSystem.pas


Ignore:
Timestamp:
Dec 22, 2024, 10:52:26 AM (11 hours ago)
Author:
chronos
Message:
  • Added: More tests.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameSystem.pas

    r339 r342  
    44
    55uses
    6   Classes, SysUtils, Generics.Collections, &Unit, DOM, XMLRead, XMLWrite, XML,
     6  Classes, SysUtils, Generics.Collections, Units, DOM, XMLRead, XMLWrite, XML,
    77  XMLConf, FileUtil, LazFileUtils, MapType, Nation, Building, ItemList, UnitKind;
    88
     
    2727    function GetName: string;
    2828    procedure Assign(Source: TGameSystem);
     29    function Compare(GameSystem: TGameSystem): Boolean;
    2930    procedure LoadFromNode(Node: TDOMNode);
    3031    procedure SaveToNode(Node: TDOMNode);
     
    133134  BuildingKinds.Assign(Source.BuildingKinds);
    134135  Nations.Assign(Source.Nations);
     136end;
     137
     138function TGameSystem.Compare(GameSystem: TGameSystem): Boolean;
     139begin
     140  Result := (FileName = GameSystem.FileName) and
     141    (UnitsMoveImmediately = GameSystem.UnitsMoveImmediately) and
     142    (MaxPlayerCount = GameSystem.MaxPlayerCount) and
     143    (UnitsSplitMerge = GameSystem.UnitsSplitMerge) and
     144    (EmptyCellsNeutral = GameSystem.EmptyCellsNeutral) and
     145    (PreferedMapType = GameSystem.PreferedMapType); // and
     146    //(UnitKinds.Assign(GameSystem.UnitKinds) and
     147    //(BuildingKinds.Assign(GameSystem.BuildingKinds) and
     148    //(Nations.Assign(GameSystem.Nations);
    135149end;
    136150
Note: See TracChangeset for help on using the changeset viewer.