Changeset 281 for trunk/UGameSystem.pas


Ignore:
Timestamp:
Feb 21, 2019, 10:45:41 PM (6 years ago)
Author:
chronos
Message:
  • Added: New map type hexagonal horizontal.
  • Added: Limit allowed map type according selected game system.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGameSystem.pas

    r277 r281  
    77uses
    88  Classes, SysUtils, fgl, UUnit, DOM, XMLRead, XMLWrite, UXMLUtils, XMLConf,
    9   FileUtil;
     9  FileUtil, UMapType;
    1010
    1111type
     
    2121    EmptyCellsNeutral: Boolean;
    2222    UnitsMoveImmediately: Boolean;
     23    PreferedMapType: TMapType;
    2324    constructor Create;
    2425    destructor Destroy; override;
     
    99100  UnitsSplitMerge := Source.UnitsSplitMerge;
    100101  EmptyCellsNeutral := Source.EmptyCellsNeutral;
     102  PreferedMapType := Source.PreferedMapType;
    101103  UnitKinds.Assign(Source.UnitKinds);
    102104end;
     
    109111  EmptyCellsNeutral := ReadBoolean(Node, 'EmptyCellsNeutral', False);
    110112  UnitsMoveImmediately := ReadBoolean(Node, 'UnitsMoveImmediately', False);
     113  PreferedMapType := TMapType(ReadInteger(Node, 'PreferedMapType', Integer(mtNone)));
    111114
    112115  NewNode := Node.FindNode('UnitKinds');
     
    122125  WriteBoolean(Node, 'EmptyCellsNeutral', EmptyCellsNeutral);
    123126  WriteBoolean(Node, 'UnitsMoveImmediately', UnitsMoveImmediately);
     127  WriteInteger(Node, 'PreferedMapType', Integer(PreferedMapType));
    124128
    125129  NewNode := Node.OwnerDocument.CreateElement('UnitKinds');
     
    171175    EmptyCellsNeutral := GetValue(DOMString(Path + '/EmptyCellsNeutral'), False);
    172176    UnitsMoveImmediately := GetValue(DOMString(Path + '/UnitsMoveImmediately'), False);
     177    PreferedMapType := TMapType(GetValue(DOMString(Path + '/PreferedMapType'), Integer(mtNone)));
    173178  end;
    174179end;
     
    180185    SetValue(DOMString(Path + '/EmptyCellsNeutral'), EmptyCellsNeutral);
    181186    SetValue(DOMString(Path + '/UnitsMoveImmediately'), UnitsMoveImmediately);
     187    SetValue(DOMString(Path + '/PreferedMapType'), Integer(PreferedMapType));
    182188  end;
    183189end;
Note: See TracChangeset for help on using the changeset viewer.