public bool IsCouldToPos(string pos)
    {
        string[]          tp   = pos.Split('-');
        int               row  = Convert.ToInt32(tp[0].Substring(2));
        ChessBoardPosType psTP = ChessBoardLogicData.Instance.GetChessPosType(pos);

        if (GetChessType() == ChessType.JunQi)
        {
            if (psTP != ChessBoardPosType.BY)
            {
                return(false);
            }
        }
        else if (GetChessType() == ChessType.ZhaDan)
        {
            if (row == 0)
            {
                return(false);
            }
        }
        else if (GetChessType() == ChessType.DiLei)
        {
            if (row < 4)
            {
                return(false);
            }
        }
        return(true);
    }
    private void SetPosType(ChessBoardPosType Type, string Pos)
    {
        ChessPosLogic tp = FindPosWithPos(Pos);

        tp.CsType = Type;
    }
Exemple #3
0
 public ChessPosLogic(string localPos = "", string globalPos = "", bool isOccupied = false, ChessBoardPosType csType = ChessBoardPosType.Nomal)
 {
     nodes       = new List <ChessPosLogic>();
     _localPos   = localPos;
     _globalPos  = globalPos;
     _isOccupied = isOccupied;
 }