Esempio n. 1
0
 public void geteaten(Queen c, Board x, int a)
 {
     if (a == 1)
     {
         if (x.count == 4)
         {
             x.count = 0;
             x.n += 70;
         }
         c.coords = new Point(x.n, x.m + (70 * x.count));
         x.count++;
     }
     else
     {
         if (x.count2 == 4)
         {
             x.count2 = 0;
             x.o += 70;
         }
         c.coords = new Point(x.o, x.p + (70 * x.count2));
         x.count2++;
     }
 }
Esempio n. 2
0
 public void move(Queen c, Point s, Board x, int a)
 {
     int t = x.board[s.X, s.Y];
     Boolean skip = true;
     x.cannotmove = false;
     int numx2 = x.numx;
     int numy2 = x.numy;
     Point unmove = new Point(c.coords.X, c.coords.Y);            
     if (x.board[s.X, s.Y] != 0 && x.board[s.X, s.Y] * a < 0)
     {
         if (x.checkmachecker)
         {
             skip = false;
         }
         else
         {
             x.eat(s, x);
         }
     }
     c.coords = new Point(x.Grid[s.X, s.Y].X + 23, x.Grid[s.X, s.Y].Y + 5);
     x.board[s.X, s.Y] = a;
     Boolean kingcheck = false;
     x.turner = x.turner * -1;
     if (skip)
     {
         if (x.turncount % 2 == 0)
         {
             kingcheck = x.checkcheck(x, x.whiteking);
         }
         else
         {
             kingcheck = x.checkcheck(x, x.blacking);
         }
     }
     if (kingcheck || x.checkmachecker)
     {
         c.coords = new Point(unmove.X, unmove.Y);
         x.board[s.X, s.Y] = t;
         x.board[numx2, numy2] = a;
         if (kingcheck)
         {
             x.cannotmove = true;
         }
     }
     x.numx = numx2;
     x.numy = numy2;
     x.turner = x.turner * -1;
 }