Ejemplo n.º 1
0
 public bool checkLeft(pown pw)
 {
     if (pw.getCol() != 0)
     {
         if (Boardcells[pw.getRow(), pw.getCol() - 1].Empty())
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool checkRight(pown pw)
 {
     if (pw.getCol() != 3)
     {
         if (Boardcells[pw.getRow(), pw.getCol() + 1].Empty())
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
        //Switch between empty and given pown cells
        public void switchPowns(pown pw)
        {
            pown temp      = new pown(pw.getRow(), pw.getCol(), pw.getValue());
            pown empty_pow = Boardcells[rowempty, colempty];

            pw.setX(rowempty);
            pw.setY(colempty);
            //pw.setEmpty(false);
            Boardcells[rowempty, colempty] = pw;
            rowempty = temp.getRow();
            colempty = temp.getCol();
            empty_pow.setX(rowempty);
            empty_pow.setY(colempty);
            Boardcells[rowempty, colempty] = empty_pow;
        }