Changeset 23 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 2, 2014, 11:27:14 PM (11 years ago)
Author:
chronos
Message:
  • Modified: Calculation of player visible frame is now handled by TView class.
  • Fixed: Set proper max power on existing player move update.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r22 r23  
    2828  private
    2929    FInitialized: Boolean;
    30     procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce, CountRepeat: Integer);
     30    procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
     31      CountRepeat: Integer; Update: Boolean);
    3132    procedure DoOnWin(Player: TPlayer);
    3233  public
     
    5455
    5556procedure TCore.DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
    56   CountRepeat: Integer);
     57  CountRepeat: Integer; Update: Boolean);
    5758begin
     59  if Update then FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower + CountOnce
     60    else FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower;
    5861  FormMove.SpinEditOnce.Value := CountOnce;
    59   FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower;
     62  FormMove.SpinEditRepeat.MaxValue := Game.Map.MaxPower;
    6063  FormMove.SpinEditRepeat.Value := CountRepeat;
    61   FormMove.SpinEditRepeat.MaxValue := Game.Map.MaxPower;
    6264  if FormMove.ShowModal = mrOk then begin
    6365    CountOnce := FormMove.SpinEditOnce.Value;
     
    128130  FInitialized := True;
    129131  for I := 0 to Game.Players.Count - 1 do
    130     TPlayer(Game.Players[I]).ViewSize := Point(FormMain.PaintBox1.Width,
     132    TPlayer(Game.Players[I]).View.DestRect := Rect(0, 0, FormMain.PaintBox1.Width,
    131133      FormMain.PaintBox1.Height);
    132134  Game.New;
Note: See TracChangeset for help on using the changeset viewer.