Changeset 17 for trunk/Forms


Ignore:
Timestamp:
Oct 5, 2019, 12:17:17 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Tiles matrix moved to separate class called TBoard.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r12 r17  
    5959      40: MovedCount := Core.Game.MoveAll(drDown);
    6060    end;
    61     if MovedCount > 0 then Core.Game.FillRandomCell;
    62     if not Core.Game.CanMove and (Core.Game.GetEmptyCellsCount = 0) then
     61    if MovedCount > 0 then Core.Game.FillRandomTile;
     62    if not Core.Game.CanMove and (Core.Game.Board.GetEmptyTilesCount = 0) then
    6363      Core.Game.GameOver;
    64     if (not Core.Game.Won) and (Core.Game.GetHighestCellValue >= 2048) then
     64    if (not Core.Game.Won) and (Core.Game.Board.GetHighestTileValue >= 2048) then
    6565      Core.Game.Win;
    6666  end;
  • trunk/Forms/UFormNew.pas

    r15 r17  
    4545procedure TFormNew.Load(Game: TGame);
    4646begin
    47   ComboBoxSize.ItemIndex := Game.Size.X - 3;
     47  ComboBoxSize.ItemIndex := Game.Board.Size.X - 3;
    4848end;
    4949
    5050procedure TFormNew.Save(Game: TGame);
    5151begin
    52   Game.Size := Point(3 + ComboBoxSize.ItemIndex, 3 + ComboBoxSize.ItemIndex);
     52  Game.Board.Size := Point(3 + ComboBoxSize.ItemIndex, 3 + ComboBoxSize.ItemIndex);
    5353end;
    5454
Note: See TracChangeset for help on using the changeset viewer.