/// <summary>Creates a new instance of the MapDisplay class.</summary>
   protected MapDisplay(Size sizeHexes, Size gridSize, InitializeHex initializeHex, IFastList <HexCoords> landmarkCoords)
       : base(sizeHexes, gridSize, landmarkCoords, GetGraphicsPath
 #if FlatBoardStorage
              , () => new FlatBoardStorage <THex>(sizeHexes, coords => initializeHex(board, coords))
 #else
              , () => new BlockedBoardStorage32x32 <THex>(sizeHexes, coords => initializeHex(GetGraphicsPath(gridSize), coords))
 #endif
              )
   {
       InitializeProperties();
       var grid = TransposableHexgrid.GetNewGrid(false, gridSize, 1.0F);
   }
Пример #2
0
        ///// <summary>Return new AutoScrollPosition for applied muse-wheel scroll.</summary>
        //static Point WheelPanel(ScrollProperties scroll, int delta, ref int remainder,
        //  Func<int,Point> newAutoScroll)
        //{
        //  if (Math.Sign(delta) != Math.Sign(remainder)) remainder = 0;
        //  var steps = (delta+remainder)
        //            / (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);
        //  remainder = (delta+remainder)
        //            % (SystemInformation.MouseWheelScrollDelta / SystemInformation.MouseWheelScrollLines);
        //  return newAutoScroll(scroll.SmallChange * steps);
        //}
        ///// <summary>TODO</summary>
        //static ScrollEventArgs GetScrollEventArgs(bool isHorizontal, Point oldScroll, Point newScroll) {
        //  return new ScrollEventArgs(
        //    ScrollEventType.ThumbTrack,
        //    isHorizontal ? -oldScroll.X : -oldScroll.Y,
        //    isHorizontal ? -newScroll.X : -newScroll.Y,
        //    isHorizontal ? ScrollOrientation.HorizontalScroll : ScrollOrientation.VerticalScroll
        //  );
        //}

        /// <summary>TODO</summary>
        //public void SetModel(IMapDisplayWinForms model) {
        //  Model = model;
        //}

        IHexgrid GetHexgrid()
        {
            var margin = Margin.OffsetSize();

            return(TransposableHexgrid.GetNewGrid(IsTransposed, Model.GridSize, MapScale, margin));
        }