ChessServer.GameLogic.AttackMap.CastlingFunc C# (CSharp) Method

CastlingFunc() private method

private CastlingFunc ( Board board, Figure king, Figure rook, int rows, char rookX ) : void
board Protocol.GameObjects.Board
king Protocol.GameObjects.Figure
rook Protocol.GameObjects.Figure
rows int
rookX char
return void
        private void CastlingFunc(Board board, Figure king, Figure rook, int rows, char rookX)
        {
            if (rookX == 'a')
            {
                if (board["b" + rows].GetType() == typeof(FigureNone) &&
                    board["c" + rows].GetType() == typeof(FigureNone) &&
                    board["d" + rows].GetType() == typeof(FigureNone) &&
                    IsColorFigureAttack(this["c" + rows], king.Side) &&
                    IsColorFigureAttack(this["d" + rows], king.Side))
                {
                    Attackers['c' - 'a', rows - 1].Add(king);
                    //Attackers['d' - 'a', rows - 1].Add(rook);
                }
            }
            else if (rookX == 'h')
            {
                if (board["f" + rows].GetType() == typeof(FigureNone) &&
                    board["g" + rows].GetType() == typeof(FigureNone) &&
                    IsColorFigureAttack(this["f" + rows], king.Side) &&
                    IsColorFigureAttack(this["g" + rows], king.Side))
                {
                    Attackers['g' - 'a', rows - 1].Add(king);
                    //Attackers['f' - 'a', rows - 1].Add(rook);
                }
            }
        }