public void HudLayoutGraphToolCanBeSerializedDeserializedWithProtobuf()
        {
            var hudLayoutToolExpected = new HudLayoutGraphTool
            {
                BaseStat = new StatInfo {
                    Stat = Stat.CBet
                },
                IsVertical = true,
                ParentId   = Guid.NewGuid(),
                Stats      = new ReactiveList <StatInfo> {
                    new StatInfo {
                        Stat = Stat.AGG
                    }
                }
            };

            var hudLayoutToolActual = SerializerHelper.GetSerializedDeserializedObject(hudLayoutToolExpected);

            Assert.That(hudLayoutToolActual.Id, Is.EqualTo(hudLayoutToolExpected.Id));
            Assert.That(hudLayoutToolActual.IsVertical, Is.EqualTo(hudLayoutToolExpected.IsVertical));
            Assert.That(hudLayoutToolActual.BaseStat.Stat, Is.EqualTo(hudLayoutToolExpected.BaseStat.Stat));
            Assert.That(hudLayoutToolActual.ParentId, Is.EqualTo(hudLayoutToolExpected.ParentId));
            Assert.That(hudLayoutToolActual.Stats.Count, Is.EqualTo(hudLayoutToolExpected.Stats.Count));
            Assert.That(hudLayoutToolActual.Stats.First().Stat, Is.EqualTo(hudLayoutToolExpected.Stats.First().Stat));
        }
        public void HudGraphViewModelToolCanBeSerializedDeserializedWithProtobuf()
        {
            var hudLayoutToolExpected = new HudLayoutGraphTool
            {
                BaseStat = new StatInfo {
                    Stat = Stat.CBet
                },
                IsVertical = true,
                Stats      = new ReactiveList <StatInfo> {
                    new StatInfo {
                        Stat = Stat.AGG
                    }
                },
                ParentId = Guid.NewGuid()
            };

            var hudElement = new HudElementViewModel
            {
                Seat = 1,
            };

            var hudToolViewModelExpected = hudLayoutToolExpected.CreateViewModel(hudElement) as HudGraphViewModel;

            var hudToolViewModelActual = SerializerHelper.GetSerializedDeserializedObject(hudToolViewModelExpected);

            Assert.That(hudToolViewModelActual.Id, Is.EqualTo(hudToolViewModelExpected.Id));
            Assert.That(hudToolViewModelActual.ToolType, Is.EqualTo(hudToolViewModelExpected.ToolType));
            Assert.That(hudToolViewModelActual.BaseStat.Stat, Is.EqualTo(hudToolViewModelExpected.BaseStat.Stat));
            Assert.That(hudToolViewModelActual.Width, Is.EqualTo(hudToolViewModelExpected.Width));
            Assert.That(hudToolViewModelActual.Height, Is.EqualTo(hudToolViewModelExpected.Height));
            Assert.That(hudToolViewModelActual.Position, Is.EqualTo(hudToolViewModelExpected.Position));
            Assert.That(hudToolViewModelActual.Stats.Count, Is.EqualTo(hudToolViewModelExpected.Stats.Count));
            Assert.That(hudToolViewModelActual.Stats.First().Stat, Is.EqualTo(hudToolViewModelExpected.Stats.First().Stat));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize an instance of <see cref="HudGraphViewModel"/>
        /// </summary>
        /// <param name="tool"><see cref="HudLayoutGraphTool"/> to initialize an instance</param>
        private HudGraphViewModel(HudLayoutGraphTool tool) : this()
        {
            Check.ArgumentNotNull(() => tool);

            this.tool = tool;

            if (Stats != null)
            {
                Stats.CollectionChanged += OnStatsCollectionChanged;
            }

            InitializeCommands();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates graph view model
        /// </summary>
        /// <param name="creationInfo"><see cref="HudToolCreationInfo"/></param>
        /// <returns>Graph view model</returns>
        private HudBaseToolViewModel CreateGraphTool(HudToolCreationInfo creationInfo)
        {
            Check.Require(creationInfo.Layout != null, "Layout isn't defined. Graph has not been created.");

            var statInfo = creationInfo.Source as StatInfo;

            HudLayoutGraphTool layoutTool = null;

            if (statInfo != null)
            {
                statInfo.IsSelected = false;

                var initialStat = statInfo.Stat == Stat.PlayerInfoIcon ?
                                  StatsProvider.GetStat(Stat.NetWon) :
                                  statInfo.Clone();

                layoutTool = new HudLayoutGraphTool
                {
                    BaseStat = statInfo.Clone(),
                    Stats    = new ReactiveList <StatInfo> {
                        initialStat
                    }
                };
            }
            else
            {
                var parentTool = creationInfo.Source as HudBaseToolViewModel;

                if (parentTool == null)
                {
                    return(null);
                }

                layoutTool = new HudLayoutGraphTool
                {
                    ParentId = parentTool.Tool.Id
                };
            }

            var toolViewModel = layoutTool.CreateViewModel(creationInfo.HudElement);

            toolViewModel.Position = creationInfo.Position;

            creationInfo.Layout.LayoutTools.Add(layoutTool);

            return(toolViewModel);
        }
        /// <summary>
        /// Creates <see cref="HudLayoutInfoV2"/> for tests, all tools must be included
        /// </summary>
        /// <returns><see cref="HudLayoutInfoV2"/></returns>
        private static HudLayoutInfoV2 CreateHudLayoutInfo()
        {
            var hudLayoutInfo = new HudLayoutInfoV2
            {
                TableType = EnumTableType.HU,
                Name      = "TestLayout",
                Filter    = new HudLayoutFilter
                {
                    DataFreshness = 30,
                    TableTypes    = new[] { (int)EnumTableType.HU, (int)EnumTableType.Six }
                },
                TrackMeterPositions = new List <HudPositionsInfo>
                {
                    new HudPositionsInfo
                    {
                        GameType     = EnumGameType.MTTHoldem,
                        PokerSite    = EnumPokerSites.Bodog,
                        HudPositions = new List <HudPositionInfo>
                        {
                            new HudPositionInfo
                            {
                                Position = new System.Windows.Point(1, 15)
                            }
                        }
                    }
                }
            };

            var plainBoxTool = new HudLayoutPlainBoxTool
            {
                Positions = new List <HudPositionsInfo>
                {
                    new HudPositionsInfo
                    {
                        GameType     = EnumGameType.CashHoldem,
                        HudPositions = new List <HudPositionInfo>
                        {
                            new HudPositionInfo
                            {
                                Position = new System.Windows.Point(1, 1),
                                Seat     = 1,
                                Width    = 2
                            }
                        },
                        PokerSite = EnumPokerSites.Bodog
                    }
                },
                Stats = new ReactiveList <StatInfo>
                {
                    new StatInfo
                    {
                        Stat = Stat.VPIP
                    }
                }
            };

            var textboxTool = new HudLayoutTextBoxTool
            {
                Text = "Test"
            };

            var fourStatBoxTool = new HudLayoutFourStatsBoxTool
            {
                Positions = new List <HudPositionsInfo>
                {
                    new HudPositionsInfo
                    {
                        GameType     = EnumGameType.CashHoldem,
                        HudPositions = new List <HudPositionInfo>
                        {
                            new HudPositionInfo
                            {
                                Position = new System.Windows.Point(1, 1),
                                Seat     = 1,
                                Width    = 2
                            }
                        },
                        PokerSite = EnumPokerSites.Bodog
                    }
                },
                Stats = new ReactiveList <StatInfo>
                {
                    new StatInfo
                    {
                        Stat = Stat.VPIP
                    }
                }
            };

            var tiltMeterTool      = new HudLayoutTiltMeterTool();
            var playerIconTool     = new HudLayoutPlayerIconTool();
            var graphTool          = new HudLayoutGraphTool();
            var gaugeIndicatorTool = new HudLayoutGaugeIndicator();
            var bumperStickers     = new HudLayoutBumperStickersTool();
            var heatMap            = new HudLayoutHeatMapTool();

            hudLayoutInfo.LayoutTools = new List <HudLayoutTool> {
                plainBoxTool, textboxTool, fourStatBoxTool, tiltMeterTool, playerIconTool, graphTool, gaugeIndicatorTool, bumperStickers, heatMap
            };

            return(hudLayoutInfo);
        }
Ejemplo n.º 6
0
        private void MigratePopups(HudLayoutInfo layout, HudLayoutInfoV2 layoutInfoV2)
        {
            if (layout.HudStats.Any(x => x.Stat == Stat.VPIP))
            {
                var hudLayoutVPIPGaugeIndicatorTool = new HudLayoutGaugeIndicator
                {
                    BaseStat   = CreateStatInfo(Stat.VPIP),
                    Text       = "TOTAL",
                    HeaderText = "VPIP",
                    Stats      = new ReactiveList <StatInfo>
                    {
                        CreateStatInfo(Stat.VPIP_EP),
                        CreateStatInfo(Stat.VPIP_MP),
                        CreateStatInfo(Stat.VPIP_CO),
                        CreateStatInfo(Stat.VPIP_BN),
                        CreateStatInfo(Stat.VPIP_SB),
                        CreateStatInfo(Stat.VPIP_BB),
                    }
                };

                var hudLayoutColdCallGaugeIndicatorTool = new HudLayoutGaugeIndicator
                {
                    BaseStat   = CreateStatInfo(Stat.VPIP),
                    Text       = "COLD CALL",
                    HeaderText = "Cold Call",
                    Stats      = new ReactiveList <StatInfo>
                    {
                        CreateStatInfo(Stat.ColdCall_EP),
                        CreateStatInfo(Stat.ColdCall_MP),
                        CreateStatInfo(Stat.ColdCall_CO),
                        CreateStatInfo(Stat.ColdCall_BN),
                        CreateStatInfo(Stat.ColdCall_SB),
                        CreateStatInfo(Stat.ColdCall_BB),
                    }
                };

                layoutInfoV2.LayoutTools.Add(hudLayoutVPIPGaugeIndicatorTool);
                layoutInfoV2.LayoutTools.Add(hudLayoutColdCallGaugeIndicatorTool);
            }

            if (layout.HudStats.Any(x => x.Stat == Stat.PFR))
            {
                var hudLayoutPFRGaugeIndicatorTool = new HudLayoutGaugeIndicator
                {
                    BaseStat   = CreateStatInfo(Stat.PFR),
                    Text       = "UNOPENED",
                    HeaderText = "PFR",
                    Stats      = new ReactiveList <StatInfo>
                    {
                        CreateStatInfo(Stat.UO_PFR_EP),
                        CreateStatInfo(Stat.UO_PFR_MP),
                        CreateStatInfo(Stat.UO_PFR_CO),
                        CreateStatInfo(Stat.UO_PFR_BN),
                        CreateStatInfo(Stat.UO_PFR_SB)
                    }
                };

                layoutInfoV2.LayoutTools.Add(hudLayoutPFRGaugeIndicatorTool);
            }

            if (layout.HudStats.Any(x => x.Stat == Stat.S3Bet))
            {
                var hudLayout3BetGaugeIndicatorTool = new HudLayoutGaugeIndicator
                {
                    BaseStat   = CreateStatInfo(Stat.S3Bet),
                    Text       = "TOTAL",
                    HeaderText = "3-bet%",
                    Stats      = new ReactiveList <StatInfo>
                    {
                        CreateStatInfo(Stat.ThreeBet_EP),
                        CreateStatInfo(Stat.ThreeBet_MP),
                        CreateStatInfo(Stat.ThreeBet_CO),
                        CreateStatInfo(Stat.ThreeBet_BN),
                        CreateStatInfo(Stat.ThreeBet_SB),
                        CreateStatInfo(Stat.ThreeBet_BB),
                    }
                };

                layoutInfoV2.LayoutTools.Add(hudLayout3BetGaugeIndicatorTool);
            }

            if (layout.HudStats.Any(x => x.Stat == Stat.AGG))
            {
                var hudLayoutAggGaugeIndicatorTool = new HudLayoutGaugeIndicator
                {
                    BaseStat   = CreateStatInfo(Stat.AGG),
                    Text       = "TOTAL",
                    HeaderText = "AGG%",
                    Stats      = new ReactiveList <StatInfo>
                    {
                        CreateStatInfo(Stat.FlopAGG),
                        CreateStatInfo(Stat.TurnAGG),
                        CreateStatInfo(Stat.RiverAGG),
                        CreateStatInfo(Stat.RecentAgg)
                    }
                };

                layoutInfoV2.LayoutTools.Add(hudLayoutAggGaugeIndicatorTool);
            }

            if (layout.HudStats.Any(x => x.Stat == Stat.PlayerInfoIcon))
            {
                var hudLayoutGraphTool = new HudLayoutGraphTool
                {
                    BaseStat = CreateStatInfo(Stat.PlayerInfoIcon),
                    Stats    = new ReactiveList <StatInfo> {
                        CreateStatInfo(Stat.NetWon)
                    }
                };

                layoutInfoV2.LayoutTools.Add(hudLayoutGraphTool);
            }
        }
Ejemplo n.º 7
0
        private void MigrateRichLayout(HudLayoutInfo layout, HudLayoutInfoV2 layoutInfoV2)
        {
            // 4-stat box
            var hudLayout4StatBoxTool = new HudLayoutFourStatsBoxTool
            {
                IsVertical  = layout.HudViewType != HudViewType.Horizontal,
                UIPositions = (from seat in Enumerable.Range(1, (int)layout.TableType)
                               let uiPosition = layout.UiPositionsInfo.FirstOrDefault(x => x.Seat == seat)
                                                let shiftX = layout.HudViewType != HudViewType.Horizontal && IsRightOriented((int)layout.TableType, seat) ? ui4StatBoxVerticalShiftX : 0
                                                             let shiftY = layout.HudViewType == HudViewType.Horizontal ? ui4StatBoxHorizontalShiftY : 0
                                                                          let x = uiPosition != null ? uiPosition.Position.X + shiftX : 0
                                                                                  let y = uiPosition != null ? uiPosition.Position.Y + shiftY : 0
                                                                                          let width = layout.HudViewType != HudViewType.Horizontal ? HudDefaultSettings.FourStatVerticalBoxWidth : HudDefaultSettings.FourStatBoxWidth
                                                                                                      let height = layout.HudViewType != HudViewType.Horizontal ? HudDefaultSettings.FourStatVerticalBoxHeight : HudDefaultSettings.FourStatBoxHeight
                                                                                                                   select new HudPositionInfo
                {
                    Seat = seat,
                    Position = new Point(x, y + uiExtraShiftY),
                    Width = width,
                    Height = height,
                }).ToList(),
                Stats = new ReactiveList <StatInfo>(layout.HudStats
                                                    .Where(x => x.Stat != Stat.PlayerInfoIcon && x.Stat != Stat.LineBreak)
                                                    .Take(4)
                                                    .Select(x => x.Clone())),
                Positions = (from hudPositionsInfo in layout.HudPositionsInfo
                             select new HudPositionsInfo
                {
                    GameType = hudPositionsInfo.GameType,
                    PokerSite = hudPositionsInfo.PokerSite,
                    HudPositions = (from hudPosition in hudPositionsInfo.HudPositions
                                    let shiftX = layout.HudViewType != HudViewType.Horizontal && IsRightOriented((int)layout.TableType, hudPosition.Seat) ? ui4StatBoxVerticalShiftX : 0
                                                 let shiftY = layout.HudViewType == HudViewType.Horizontal ? ui4StatBoxHorizontalShiftY : 0
                                                              let offset = GetOffset(hudPositionsInfo.PokerSite, hudPositionsInfo.GameType, layout.TableType, hudPosition.Seat)
                                                                           select new HudPositionInfo
                    {
                        Seat = hudPosition.Seat,
                        Position = new Point(hudPosition.Position.X + offset.X + shiftX, hudPosition.Position.Y + offset.Y + shiftY)
                    }).ToList()
                }).ToList()
            };

            // add line breaks to vertical component
            var plainBoxStats = layout.HudStats
                                .Where(x => !hudLayout4StatBoxTool.Stats.Any(p => p.Stat == x.Stat))
                                .Select(x => x.Clone()).ToList();

            if (layout.HudViewType == HudViewType.Vertical_1)
            {
                var plainBoxStatsTemp = plainBoxStats.Where(x => x.Stat != Stat.LineBreak).ToList();
                plainBoxStats = new List <StatInfo>();

                for (var i = 0; i < plainBoxStatsTemp.Count; i++)
                {
                    plainBoxStats.Add(plainBoxStatsTemp[i]);

                    if (i != plainBoxStatsTemp.Count - 1)
                    {
                        plainBoxStats.Add(new StatInfoBreak());
                    }
                }
            }

            // plain box
            var hudLayoutPlainBoxTool = new HudLayoutPlainBoxTool
            {
                UIPositions = (from seat in Enumerable.Range(1, (int)layout.TableType)
                               let uiPosition = layout.UiPositionsInfo.FirstOrDefault(x => x.Seat == seat)
                                                let shiftX = layout.HudViewType == HudViewType.Vertical_1 ?
                                                             (IsRightOriented((int)layout.TableType, seat) ? uiPlainBoxVertical1RightOrientedShiftX : uiPlainBoxVertical1ShiftX) : 0
                                                             let shiftY = layout.HudViewType == HudViewType.Vertical_1 ? uiPlainBoxVerticalShiftY : uiPlainBoxShiftY + ui4StatBoxHorizontalShiftY
                                                                          let x = uiPosition != null ? uiPosition.Position.X + shiftX : 0
                                                                                  let y = uiPosition != null ? uiPosition.Position.Y + shiftY : 0
                                                                                          let width = layout.HudViewType == HudViewType.Vertical_1 ? uiPlainBoxVerticalWidth : HudDefaultSettings.FourStatBoxWidth
                                                                                                      let height = HudDefaultSettings.PlainStatBoxHeight
                                                                                                                   select new HudPositionInfo
                {
                    Seat = seat,
                    Position = new Point(x, y + uiExtraShiftY),
                    Width = width,
                    Height = height
                }).ToList(),

                Stats = new ReactiveList <StatInfo>(plainBoxStats),

                Positions = (from hudPositionsInfo in layout.HudPositionsInfo
                             select new HudPositionsInfo
                {
                    GameType = hudPositionsInfo.GameType,
                    PokerSite = hudPositionsInfo.PokerSite,
                    HudPositions = (from hudPosition in hudPositionsInfo.HudPositions
                                    let shiftX = layout.HudViewType == HudViewType.Vertical_1 ?
                                                 (IsRightOriented((int)layout.TableType, hudPosition.Seat) ? uiPlainBoxVertical1RightOrientedShiftX : uiPlainBoxVertical1ShiftX) : 0
                                                 let shiftY = layout.HudViewType == HudViewType.Vertical_1 ? uiPlainBoxVerticalShiftY : uiPlainBoxShiftY + ui4StatBoxHorizontalShiftY
                                                              let offset = GetOffset(hudPositionsInfo.PokerSite, hudPositionsInfo.GameType, layout.TableType, hudPosition.Seat)
                                                                           select new HudPositionInfo
                    {
                        Seat = hudPosition.Seat,
                        Position = new Point(hudPosition.Position.X + offset.X + shiftX, hudPosition.Position.Y + offset.Y + shiftY)
                    }).ToList()
                }).ToList()
            };

            // tilt meter
            var hudLayoutTiltMeterTool = new HudLayoutTiltMeterTool
            {
                UIPositions = (from seat in Enumerable.Range(1, (int)layout.TableType)
                               let uiPosition = layout.UiPositionsInfo.FirstOrDefault(x => x.Seat == seat)
                                                let shiftX = IsRightOriented((int)layout.TableType, seat) ? uiTiltMeterRightOrientedShiftX : 0
                                                             let shiftY = uiTiltMeterShiftY
                                                                          let x = uiPosition != null ? uiPosition.Position.X + shiftX : 0
                                                                                  let y = uiPosition != null ? uiPosition.Position.Y + shiftY : 0
                                                                                          let width = HudDefaultSettings.TiltMeterWidth
                                                                                                      let height = HudDefaultSettings.TiltMeterHeight
                                                                                                                   select new HudPositionInfo
                {
                    Seat = seat,
                    Position = new Point(x, y + uiExtraShiftY),
                    Width = width,
                    Height = height
                }).ToList(),

                Positions = (from hudPositionsInfo in layout.HudPositionsInfo
                             select new HudPositionsInfo
                {
                    GameType = hudPositionsInfo.GameType,
                    PokerSite = hudPositionsInfo.PokerSite,
                    HudPositions = (from hudPosition in hudPositionsInfo.HudPositions
                                    let shiftX = IsRightOriented((int)layout.TableType, hudPosition.Seat) ? uiTiltMeterRightOrientedShiftX : 0
                                                 let shiftY = uiTiltMeterShiftY
                                                              let offset = GetOffset(hudPositionsInfo.PokerSite, hudPositionsInfo.GameType, layout.TableType, hudPosition.Seat)
                                                                           select new HudPositionInfo
                    {
                        Seat = hudPosition.Seat,
                        Position = new Point(hudPosition.Position.X + offset.X + shiftX, hudPosition.Position.Y + offset.Y + shiftY)
                    }).ToList()
                }).ToList()
            };

            // player icon
            var hudLayoutPlayerIconTool = new HudLayoutPlayerIconTool
            {
                UIPositions = (from seat in Enumerable.Range(1, (int)layout.TableType)
                               let uiPosition = layout.UiPositionsInfo.FirstOrDefault(x => x.Seat == seat)
                                                let shiftX = IsRightOriented((int)layout.TableType, seat) ? uiPlayerIconRightOrientedShiftX : uiPlayerIconShiftX
                                                             let shiftY = uiPlayerIconShiftY
                                                                          let x = uiPosition != null ? uiPosition.Position.X + shiftX : 0
                                                                                  let y = uiPosition != null ? uiPosition.Position.Y + shiftY : 0
                                                                                          let width = HudDefaultSettings.PlayerIconWidth
                                                                                                      let height = HudDefaultSettings.PlayerIconHeight
                                                                                                                   select new HudPositionInfo
                {
                    Seat = seat,
                    Position = new Point(x, y + uiExtraShiftY),
                    Width = width,
                    Height = height
                }).ToList(),

                Positions = (from hudPositionsInfo in layout.HudPositionsInfo
                             select new HudPositionsInfo
                {
                    GameType = hudPositionsInfo.GameType,
                    PokerSite = hudPositionsInfo.PokerSite,
                    HudPositions = (from hudPosition in hudPositionsInfo.HudPositions
                                    let shiftX = IsRightOriented((int)layout.TableType, hudPosition.Seat) ? uiPlayerIconRightOrientedShiftX : uiPlayerIconShiftX
                                                 let shiftY = uiPlayerIconShiftY
                                                              let offset = GetOffset(hudPositionsInfo.PokerSite, hudPositionsInfo.GameType, layout.TableType, hudPosition.Seat)
                                                                           select new HudPositionInfo
                    {
                        Seat = hudPosition.Seat,
                        Position = new Point(hudPosition.Position.X + offset.X + shiftX, hudPosition.Position.Y + offset.Y + shiftY)
                    }).ToList()
                }).ToList()
            };

            var hudLayoutGraphTool = new HudLayoutGraphTool
            {
                ParentId = hudLayoutPlayerIconTool.Id,
                Stats    = new ReactiveList <StatInfo> {
                    CreateStatInfo(Stat.NetWon)
                }
            };

            // bumper stickers
            var hudLayoutBumperStickersTool = new HudLayoutBumperStickersTool
            {
                UIPositions = (from seat in Enumerable.Range(1, (int)layout.TableType)
                               let uiPosition = layout.UiPositionsInfo.FirstOrDefault(x => x.Seat == seat)
                                                let shiftX = layout.HudViewType == HudViewType.Vertical_1 ?
                                                             (IsRightOriented((int)layout.TableType, seat) ? uiPlainBoxVertical1RightOrientedShiftX : uiPlainBoxVertical1ShiftX) : 0
                                                             let shiftY = layout.HudViewType == HudViewType.Vertical_1 ? uiPlainBoxVerticalShiftY : uiPlainBoxShiftY + ui4StatBoxHorizontalShiftY
                                                                          let x = uiPosition != null ? uiPosition.Position.X + shiftX : 0
                                                                                  let y = (uiPosition != null ? uiPosition.Position.Y + shiftY : 0) + uiBumperStickerShiftY
                                                                                          let width = HudDefaultSettings.BumperStickersWidth
                                                                                                      let height = HudDefaultSettings.BumperStickersHeight
                                                                                                                   select new HudPositionInfo
                {
                    Seat = seat,
                    Position = new Point(x, y + uiExtraShiftY),
                    Width = width,
                    Height = height
                }).ToList(),

                Positions = (from hudPositionsInfo in layout.HudPositionsInfo
                             select new HudPositionsInfo
                {
                    GameType = hudPositionsInfo.GameType,
                    PokerSite = hudPositionsInfo.PokerSite,
                    HudPositions = (from hudPosition in hudPositionsInfo.HudPositions
                                    let shiftX = layout.HudViewType == HudViewType.Vertical_1 ?
                                                 (IsRightOriented((int)layout.TableType, hudPosition.Seat) ? uiPlainBoxVertical1RightOrientedShiftX : uiPlainBoxVertical1ShiftX) : 0
                                                 let shiftY = layout.HudViewType == HudViewType.Vertical_1 ? uiPlainBoxVerticalShiftY : uiPlainBoxShiftY + ui4StatBoxHorizontalShiftY
                                                              let offset = GetOffset(hudPositionsInfo.PokerSite, hudPositionsInfo.GameType, layout.TableType, hudPosition.Seat)
                                                                           select new HudPositionInfo
                    {
                        Seat = hudPosition.Seat,
                        Position = new Point(hudPosition.Position.X + offset.X + shiftX, hudPosition.Position.Y + offset.Y + shiftY + uiBumperStickerShiftY)
                    }).ToList()
                }).ToList()
            };

            layoutInfoV2.LayoutTools = new List <HudLayoutTool> {
                hudLayout4StatBoxTool, hudLayoutPlainBoxTool, hudLayoutTiltMeterTool, hudLayoutPlayerIconTool, hudLayoutGraphTool, hudLayoutBumperStickersTool
            };

            MigratePopups(layout, layoutInfoV2);
        }
Ejemplo n.º 8
0
 /// <summary>
 ///  Initialize an instance of <see cref="HudGraphViewModel"/>
 /// </summary>
 /// <param name="tool"><see cref="HudLayoutGraphTool"/> to initialize an instance</param>
 /// <param name="parent">Parent <see cref="HudElementViewModel"/> to initialize an instance</param>
 public HudGraphViewModel(HudLayoutGraphTool tool, HudElementViewModel parent) : this(tool)
 {
     Check.ArgumentNotNull(() => parent);
     Parent = parent;
 }