Changeset 262 for trunk/UGame.pas


Ignore:
Timestamp:
Sep 24, 2018, 11:46:31 PM (6 years ago)
Author:
chronos
Message:
  • Added: New game option to set cells without player units as neutral.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r251 r262  
    7777    BridgeEnabled: Boolean;
    7878    MaxPower: Integer;
     79    EmptyCellsNeutral: Boolean;
    7980    procedure PostConfig;
    8081    procedure Assign(Source: TGame);
     
    427428  BridgeEnabled := Source.BridgeEnabled;
    428429  MaxPower := Source.MaxPower;
     430  EmptyCellsNeutral := Source.EmptyCellsNeutral;
    429431end;
    430432
     
    450452    SetValue(DOMString(Path + '/StayAliveForDefinedTurns'), StayAliveForDefinedTurns);
    451453    SetValue(DOMString(Path + '/SpecialCaptureCellCount'), SpecialCaptureCellCount);
     454    SetValue(DOMString(Path + '/EmptyCellsNeutral'), EmptyCellsNeutral);
    452455    Players.SaveConfig(Config, Path + '/Players');
    453456  end;
     
    485488    StayAliveForDefinedTurns := GetValue(DOMString(Path + '/StayAliveForDefinedTurns'), 20);
    486489    SpecialCaptureCellCount := GetValue(DOMString(Path + '/SpecialCaptureCellCount'), 1);
     490    EmptyCellsNeutral := GetValue(DOMString(Path + '/EmptyCellsNeutral'), False);
    487491    Players.LoadConfig(Config, Path + '/Players');
    488492  end;
     
    519523      TurnCounter := ReadInteger(RootNode, 'TurnCounter', 0);
    520524      WinObjective := TWinObjective(ReadInteger(RootNode, 'WinObjective', Integer(woDefeatAllOponents)));
    521       ReadInteger(RootNode, 'StayAliveForDefinedTurns', StayAliveForDefinedTurns);
     525      StayAliveForDefinedTurns := ReadInteger(RootNode, 'StayAliveForDefinedTurns', 10);
     526      EmptyCellsNeutral := ReadBoolean(RootNode, 'EmptyCellsNeutral', False);
    522527
    523528      NewNode := FindNode('Map');
     
    573578      WriteInteger(RootNode, 'WinObjective', Integer(WinObjective));
    574579      WriteInteger(RootNode, 'StayAliveForDefinedTurns', StayAliveForDefinedTurns);
     580      WriteBoolean(RootNode, 'EmptyCellsNeutral', EmptyCellsNeutral);
    575581      WriteBoolean(RootNode, 'Running', Running);
    576582
     
    641647  CurrentPlayer.MoveAll;
    642648  CurrentPlayer.Grow;
     649  CurrentPlayer.UpdateEmptyCellsNeutral;
    643650  CurrentPlayer.UpdateRepeatMoves;
    644651  ComputePlayerStats;
Note: See TracChangeset for help on using the changeset viewer.