Changeset 31 for trunk/Forms


Ignore:
Timestamp:
Oct 12, 2019, 10:47:02 PM (5 years ago)
Author:
chronos
Message:
  • Added: New form accessible from menu Tools - Moves history with game moves history.
Location:
trunk/Forms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormComputer.pas

    r29 r31  
    1313  TGameTry = class
    1414    Game: TGame;
    15     Moves: array of TDirection;
     15    Moves: array of TMoveDirection;
    1616    constructor Create;
    1717    destructor Destroy; override;
     
    5858function TGameTry.GetFitness: Double;
    5959const
    60   DirWeight: array[TDirection] of Double = (0.25, -10000, 0.5, 0.75);
     60  DirWeight: array[TMoveDirection] of Double = (0, 0.25, -10000, 0.5, 0.75);
    6161var
    6262  I: Integer;
     
    221221procedure TFormComputer.TryAllDirections(GameTries: TGameTries; GameTry: TGameTry);
    222222var
    223   Direction: TDirection;
     223  Direction: TMoveDirection;
    224224  NewTry: TGameTry;
    225225begin
    226   for Direction := Low(TDirection) to High(TDirection) do begin
     226  for Direction := Low(TMoveDirection) to High(TMoveDirection) do begin
    227227    if GameTry.Game.CanMoveDirection(Direction) then begin
    228228      NewTry := TGameTry.Create;
  • trunk/Forms/UFormMain.lfm

    r29 r31  
    3737        Action = Core.AComputer
    3838      end
     39      object MenuItem5: TMenuItem
     40        Action = Core.AHistory
     41      end
    3942    end
    4043    object MenuItemHelp: TMenuItem
  • trunk/Forms/UFormMain.pas

    r29 r31  
    1919    MenuItem3: TMenuItem;
    2020    MenuItem4: TMenuItem;
     21    MenuItem5: TMenuItem;
    2122    MenuItemTools: TMenuItem;
    2223    MenuItemNew: TMenuItem;
  • trunk/Forms/UFormNew.lfm

    r28 r31  
    88  ClientWidth = 487
    99  DesignTimePPI = 144
     10  OnClose = FormClose
    1011  OnCreate = FormCreate
     12  OnShow = FormShow
    1113  LCLVersion = '2.0.2.0'
    1214  object Label1: TLabel
  • trunk/Forms/UFormNew.pas

    r28 r31  
    1919    ComboBoxSize: TComboBox;
    2020    Label1: TLabel;
     21    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2122    procedure FormCreate(Sender: TObject);
     23    procedure FormShow(Sender: TObject);
    2224  private
    2325
     
    4446end;
    4547
     48procedure TFormNew.FormShow(Sender: TObject);
     49begin
     50  Core.PersistentForm1.Load(Self);
     51end;
     52
     53procedure TFormNew.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     54begin
     55  Core.PersistentForm1.Save(Self);
     56end;
     57
    4658procedure TFormNew.Load(Game: TGame);
    4759begin
Note: See TracChangeset for help on using the changeset viewer.