Queem.Core.ChessBoard.PlayerBoard.AddPromotionMoves C# (CSharp) Method

AddPromotionMoves() protected method

protected AddPromotionMoves ( Move innerArray, int index, Figure destinationFigure ) : void
innerArray Queem.Core.Move
index int
destinationFigure Figure
return void
        protected void AddPromotionMoves(Move[] innerArray, int index, Figure destinationFigure)
        {
            if (destinationFigure != Figure.Nobody)
            {
                innerArray[index].Type = MoveType.KnightPromoCapture;
                innerArray[index + 1].Type = MoveType.BishopPromoCapture;
                innerArray[index + 2].Type = MoveType.RookPromoCapture;
                innerArray[index + 3].Type = MoveType.QueenPromoCapture;
            }
            else
            {
                innerArray[index].Type = MoveType.KnightPromotion;
                innerArray[index + 1].Type = MoveType.BishopPromotion;
                innerArray[index + 2].Type = MoveType.RookPromotion;
                innerArray[index + 3].Type = MoveType.QueenPromotion;
            }

            for (int i = 0; i < 4; ++i)
                innerArray[i].Value += (int)innerArray[i].Type * MoveTypeWeight;
        }