private void updateLegalJumpList() { int[] rowOffsetsArr, colOffsetsArr; Square dest; LegalJump legalJump; m_ActivePlayer.LegalJumpList.Clear(); updateCaptureIsAvailable(); foreach (Pawn pawn in m_ActivePlayer.PawnList) { pawn.ClearLegalJumpList(); setRowAndColOffsetsByPawnType(pawn, out rowOffsetsArr, out colOffsetsArr); for (int index = 0; index < rowOffsetsArr.Length; index++) { dest = m_Board.GetSquareByPosition( pawn.OnSquare.Row + rowOffsetsArr[index], pawn.OnSquare.Col + colOffsetsArr[index]); if (isValidJump(pawn, dest)) { legalJump = new LegalJump(pawn, dest); pawn.AddLegalJump(legalJump); m_ActivePlayer.LegalJumpList.Add(legalJump); } } } }
internal void AddLegalJump(LegalJump i_LegalJump) { m_LegalJumps.Add(i_LegalJump); }