Пример #1
0
        private CustomBasicList <TrickCoordinate> GetCoordinateList()
        {
            if (_gameContainer.PlayerList.Count() != 2)
            {
                throw new BasicBlankException("This is a 2 player game.");
            }
            CustomBasicList <TrickCoordinate> output = new CustomBasicList <TrickCoordinate>();
            int             y = _gameContainer.SelfPlayer;
            int             x;
            TrickCoordinate thisPlayer;

            for (x = 1; x <= 2; x++)
            {
                thisPlayer = new TrickCoordinate();
                if (x == 1)
                {
                    thisPlayer.IsSelf = true;
                    thisPlayer.Column = 2;
                    thisPlayer.Text   = "Your Hand:"; // had to summarize so it works better for mobile.
                }
                else
                {
                    thisPlayer.PossibleDummy = true;
                    thisPlayer.Column        = 1;
                    thisPlayer.Text          = "Your Bar:";
                }
                thisPlayer.Row    = 2; // i think
                thisPlayer.Player = y;
                output.Add(thisPlayer);
            }
            if (y == 1)
            {
                y = 2;
            }
            else
            {
                y = 1;
            }
            for (x = 1; x <= 2; x++)
            {
                thisPlayer        = new TrickCoordinate();
                thisPlayer.Row    = 1;
                thisPlayer.Player = y;
                if (x == 1)
                {
                    thisPlayer.Column = 2;
                    thisPlayer.Text   = "Opponent Hand:";
                }
                else
                {
                    thisPlayer.PossibleDummy = true; // forgot this part.
                    thisPlayer.Text          = "Opponent Bar:";
                    thisPlayer.Column        = 1;
                }
                output.Add(thisPlayer);
            }
            return(output);
        }
Пример #2
0
        private (int Left, int Top) GetCoortinates(EnumCategory category, TrickCoordinate privateCoordinate)
        {
            int newLeft;
            int newTop;
            int x;

            if (privateCoordinate.Row == 1)
            {
                if (category == EnumCategory.Label)
                {
                    newTop = 2;
                }
                else
                {
                    newTop = 27;// i think 15 pixels for label.  if i am wrong, can fix.
                }
                newLeft = 2;
                if (privateCoordinate.Column == 1)
                {
                    return(newLeft, newTop);
                }
                var loopTo = privateCoordinate.Column;
                for (x = 2; x <= loopTo; x++)
                {
                    newLeft += 150;// will do 150 pixels.  that can always change as well.
                }
                return(newLeft, newTop);
            }
            if (privateCoordinate.Row != 2)
            {
                throw new BasicBlankException("Row not supported");
            }
            if (category == EnumCategory.Label)
            {
                newTop = 200;
            }
            else
            {
                newTop = 225;
            }
            newLeft = 2;
            if (privateCoordinate.Column == 1)
            {
                return(newLeft, newTop);
            }
            var loopTo1 = privateCoordinate.Column;

            for (x = 2; x <= loopTo1; x++)
            {
                newLeft += 150;// will do 150 pixels.  that can always change as well.
            }
            return(newLeft, newTop);
        }
Пример #3
0
        private TextBlock GetLabel(string text, TrickCoordinate thisView)
        {
            TextBlock thisLabel = new TextBlock();

            thisLabel.Foreground = Brushes.Aqua;
            thisLabel.FontWeight = FontWeights.Bold;
            if (!string.IsNullOrEmpty(thisView.Text))
            {
                thisLabel.Text        = thisView.Text;
                thisLabel.DataContext = thisView;
                var ThisBind = GetVisibleBinding(nameof(TrickCoordinate.Visible));
                thisLabel.SetBinding(TextBlock.VisibilityProperty, ThisBind); // to hook up so we know if its visible or not.
            }
            else
            {
                thisLabel.Text = text;
            }
            return(thisLabel);
        }
Пример #4
0
        private Label GetLabel(string text, TrickCoordinate thisView)
        {
            Label thisLabel = new Label();

            thisLabel.TextColor      = Color.Aqua;
            thisLabel.FontAttributes = FontAttributes.Bold;
            if (!string.IsNullOrEmpty(thisView.Text))
            {
                thisLabel.Text           = thisView.Text;
                thisLabel.BindingContext = thisView;
                var ThisBind = new Binding(nameof(TrickCoordinate.Visible));
                thisLabel.SetBinding(IsVisibleProperty, ThisBind); // to hook up so we know if its visible or not.
            }
            else
            {
                thisLabel.Text = text;
            }
            return(thisLabel);
        }