Changeset 415
Legend:
- Unmodified
- Added
- Removed
-
trunk/Game.pas
r414 r415 872 872 begin 873 873 Winner := nil; 874 if WinObjective = woDefeatAllOponentsthen begin874 if (WinObjective = woDefeatAllOponents) and (Players.Count > 1) then begin 875 875 AlivePlayers := Players.GetAlivePlayers; 876 876 if (Length(AlivePlayers) <= 1) then begin -
trunk/View.pas
r404 r415 142 142 R: TRect; 143 143 begin 144 if TGame(Game).Map.Cyclic then begin145 R := CellToCanvasRect( TGame(Game).Map.PixelRect);144 if Game.Map.Cyclic then begin 145 R := CellToCanvasRect(Game.Map.PixelRect); 146 146 CellPos := TPoint.Create( 147 147 ModNeg(Pos.X - R.P1.X, R.Size.X) + R.P1.X, … … 156 156 if Assigned(NewSelectedCell) then begin 157 157 if Assigned(SelectedCell) and (NewSelectedCell <> SelectedCell) and 158 TGame(Game).CurrentPlayer.IsAllowedMoveTarget(SelectedCell, NewSelectedCell) then begin158 Game.CurrentPlayer.IsAllowedMoveTarget(SelectedCell, NewSelectedCell) then begin 159 159 if ssShift in ShiftState then begin 160 160 // Make maximum unit move without confirmation dialog … … 162 162 Player.Moves.Remove(SelectedCell.MovesFrom[I]); 163 163 end; 164 TGame(Game).CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power, False);164 Game.CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power, False); 165 165 SelectedCell := nil; 166 166 end else … … 170 170 for I := SelectedCell.MovesFrom.Count - 1 downto 0 do 171 171 Player.Moves.Remove(SelectedCell.MovesFrom[I]); 172 UnitMove := TGame(Game).CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power, False);172 UnitMove := Game.CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power, False); 173 173 if Assigned(UnitMove) then 174 174 UnitMove.CountRepeat := TGame(Player.Game).Map.MaxPower; … … 176 176 else SelectedCell := nil; 177 177 end else begin 178 TGame(Game).CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power);178 Game.CurrentPlayer.SetMove(SelectedCell, NewSelectedCell, SelectedCell.MapCell.OneUnit.Power); 179 179 SelectedCell := nil; 180 180 end; … … 193 193 MapRect: TRect; 194 194 begin 195 MapRect := TGame(Game).Map.PixelRect;195 MapRect := Game.Map.PixelRect; 196 196 SourceRect := TRect.CreateBounds(TPoint.Create(MapRect.P1.X + MapRect.Size.X div 2 - SourceRect.Size.X div 2, 197 197 MapRect.P1.Y + MapRect.Size.Y div 2 - SourceRect.Size.Y div 2), … … 214 214 NewZoom: Single; 215 215 begin 216 MapRect := TGame(Game).Map.CalculatePixelRect;216 MapRect := Game.Map.CalculatePixelRect; 217 217 Factor := TPointF.Create(DestRect.Size.X / MapRect.Size.X, 218 218 DestRect.Size.Y / MapRect.Size.Y);
Note:
See TracChangeset
for help on using the changeset viewer.