This function allows the length of code to be reduced, by allowing all piece attacks to be queried in the same loop without having to check which function needs to be checked.
For example a loop to check all piece attacks will now look like:
```
for (int square = 0; square < 64; ++square)
{
for (int piece = 0; piece < 6; ++piece)
{
contention[square] += GetPieceAttacks((PieceType)piece, new Square(square), board, isWhiteFriendly);
contention[square] -= GetPieceAttacks((PieceType)piece, new Square(square), board, !isWhiteFriendly);
}
}
```
Instead of:
```
for (int square = 0; square < 64; ++square)
{
for (int piece = 0; piece < 6; ++piece)
{
switch ((PieceType)piece)
{
PieceType.Pawn => ...,
PieceType.Knight => ...,
...,
...,
}
}
}
```
This better suits the limits of the challenge by reducing the amount of lexemes required to fetch the same information.