I have a lot of debug.print lines for testing.
But some seem to be passive / do not fire.
. . .
. . .
if (bTeamOpponent == true)
{
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectGreater(cpc.Count, 0, false)))
{
for (int n = 0, loopTo2 = Conversions.ToInteger(Operators.SubtractObject(cpc.Count, 1)); n <= loopTo2; n++)
{
PlayingCard pc = (PlayingCard)CardsPanel.Children[n];
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardType, LeadSuitID, false)))
{
var sO = default(string);
if (TrumpCardID == 4)
sO = "X";
if (TrumpCardID != 4)
sO = "O";
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardShortName.Contains(sO), false, false)) && Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardShortName.Contains("U"), false, false)))
{
if (String.Equals(MyForm.sRufAs, pc.CardShortName + " " + pc.CardSymbol))
{
CurrentCard = pc;
return CurrentCard;
Debug.Print("ACP 488 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
}
else
{
CurrentCard = pc;
}
}
}
}
}
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectGreater(cpc.Count, 0, false)) && MyForm.RufAs.IsAlreadyPlayed == false && MyForm.iCoSpieler > -1)
{
for (int n = 0, loopTo3 = Conversions.ToInteger(Operators.SubtractObject(cpc.Count, 1)); n <= loopTo3; n++)
{
PlayingCard pc = (PlayingCard)CardsPanel.Children[n];
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectNotEqual(pc.CardType, TrumpCardID, false)) && Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardType, MyForm.RufAs.CardType, false)))
{
var sO = default(string);
if (TrumpCardID == 4)
sO = "X";
if (TrumpCardID != 4)
sO = "O";
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardShortName.Contains(sO), false, false)) && Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(pc.CardShortName.Contains("U"), false, false)))
{
CurrentCard = pc;
MyForm.RufAs.IsAlreadyPlayed = true;
Debug.Print("ACP 511 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
}
}
}
}
}
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectGreater(cpc.Count, 0, false)) && CurrentCard is null)
{
Debug.Print("ACP 521 sHandCards: '" + sHandCards);
Debug.Print("ACP 522 MyForm.sRufAs: '" + MyForm.sRufAs + "'");
if (SearchInCardsPanel(11, CardsPanel) is not null)
{
Debug.Print("ACP 523 SearchInCardsPanel: '" + SearchInCardsPanel(11, CardsPanel).CardShortName + " " + SearchInCardsPanel(11, CardsPanel).CardSymbol + "'");
Debug.Print(SearchInCardsPanel(11, CardsPanel).CardShortName);
Debug.Print(SearchInCardsPanel(11, CardsPanel).CardSymbol);
CurrentCard = SearchInCardsPanel(11, CardsPanel);
Debug.Print("ACP 527 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
return CurrentCard;
}
}
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectGreater(cpc.Count, 0, false)) && CurrentCard is null)
{
for (int n = 0, loopTo4 = Conversions.ToInteger(Operators.SubtractObject(cpc.Count, 1)); n <= loopTo4; n++)
{
PlayingCard pc = (PlayingCard)CardsPanel.Children[n];
if (String.Equals(MyForm.sRufAs, pc.CardShortName + " " + pc.CardSymbol))
{
if (GameStatus.ToString() != "FirstCardInTrick")
{
CurrentCard = (PlayingCard)cpc[n];
Debug.Print("ACP 549 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
}
}
}
}
if (Conversions.ToBoolean(Operators.ConditionalCompareObjectGreater(cpc.Count, 0, false)) && CurrentCard is null)
{
for (int n = 0, loopTo4 = Conversions.ToInteger(Operators.SubtractObject(cpc.Count, 1)); n <= loopTo4; n++)
{
CurrentCard = (PlayingCard)cpc[n];
Debug.Print("ACP 555 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
}
}
}
Debug.Print("ACP 558 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
return CurrentCard;
}
What I have tried:
when testing I got this result:
ACP 558 CurrentCard: '9 ♥
This comes from the end of my method:
Debug.Print("ACP 558 CurrentCard: '" + CurrentCard.CardShortName + " " + CurrentCard.CardSymbol);
This means one of the debug.print lines in the code before should fire - but does not.
What's wrong with my debug.print lines?