示例#1
0
文件: Board15.cs 项目: pavsh/15Game-3
 public bool checkLeft(pown pw)
 {
     if (pw.getCol() != 0)
     {
         if (Boardcells[pw.getRow(), pw.getCol() - 1].Empty())
         {
             return(true);
         }
     }
     return(false);
 }
示例#2
0
文件: Board15.cs 项目: pavsh/15Game-3
 public bool checkRight(pown pw)
 {
     if (pw.getCol() != 3)
     {
         if (Boardcells[pw.getRow(), pw.getCol() + 1].Empty())
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
文件: Board15.cs 项目: pavsh/15Game-3
        //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;
        }