示例#1
0
        private void JogarCarta(Peca p, int j, double o)
        {
            Image pc = new Image
            {
                Source  = new BitmapImage(p.Imagem),
                Opacity = o
            };

            Tabela.Children.Add(pc);
            switch (j)
            {
            case 0:
                Grid.SetRow(pc, 0);
                Grid.SetColumn(pc, 1);
                break;

            case 1:
                Grid.SetRow(pc, 1);
                Grid.SetColumn(pc, 0);
                break;

            case 2:
                Grid.SetRow(pc, 2);
                Grid.SetColumn(pc, 1);
                break;

            case 3:
                Grid.SetRow(pc, 1);
                Grid.SetColumn(pc, 2);
                break;
            }
            PecasColocadas.Add(pc);
        }
示例#2
0
        private void ColocarPeca(Peca p, int x, int y)
        {
            Image pc = new Image
            {
                Source = new BitmapImage(p.Imagem),
                Margin = MargemPecas
            };

            Tabela.Children.Add(pc);
            Grid.SetRow(pc, y);
            Grid.SetColumn(pc, x);
            PecasColocadas.Add(pc);
        }