private void FindDirInMid(ChessPosLogic ogl, int tp, int wb)
    {
        ChessPosLogic tep = FindPosWithPos("MD" + (tp - 1) + "-" + wb);

        if (tep != null)
        {
            ogl.AddNodes(tep);
        }
        tep = FindPosWithPos("MD" + tp + "-" + (wb + 1));
        if (tep != null)
        {
            ogl.AddNodes(tep);
        }
        tep = FindPosWithPos("MD" + (tp + 1) + "-" + wb);
        if (tep != null)
        {
            ogl.AddNodes(tep);
        }
        tep = FindPosWithPos("MD" + tp + "-" + (wb - 1));
        if (tep != null)
        {
            ogl.AddNodes(tep);
        }
    }
 private void FindDir(ChessPosLogic ogl, int tp, int wb)
 {
     if (ogl.CsType == ChessBoardPosType.XY)
     {
         ChessPosLogic tep = FindPosWithPos((tp - 1) + "-" + (wb - 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp - 1) + "-" + wb);
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp - 1) + "-" + (wb + 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos(tp + "-" + (wb + 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp + 1) + "-" + (wb + 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp + 1) + "-" + wb);
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp + 1) + "-" + (wb - 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos(tp + "-" + (wb - 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
     }
     else
     {
         ChessPosLogic tep = FindPosWithPos((tp - 1) + "-" + (wb - 1));
         if (tep != null)
         {
             if (tep.CsType == ChessBoardPosType.XY)
             {
                 ogl.AddNodes(tep);
             }
         }
         tep = FindPosWithPos((tp - 1) + "-" + wb);
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp - 1) + "-" + (wb + 1));
         if (tep != null)
         {
             if (tep.CsType == ChessBoardPosType.XY)
             {
                 ogl.AddNodes(tep);
             }
         }
         tep = FindPosWithPos(tp + "-" + (wb + 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp + 1) + "-" + (wb + 1));
         if (tep != null)
         {
             if (tep.CsType == ChessBoardPosType.XY)
             {
                 ogl.AddNodes(tep);
             }
         }
         tep = FindPosWithPos((tp + 1) + "-" + wb);
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
         tep = FindPosWithPos((tp + 1) + "-" + (wb - 1));
         if (tep != null)
         {
             if (tep.CsType == ChessBoardPosType.XY)
             {
                 ogl.AddNodes(tep);
             }
         }
         tep = FindPosWithPos(tp + "-" + (wb - 1));
         if (tep != null)
         {
             ogl.AddNodes(tep);
         }
     }
 }