U
U
Uncle Bogdan2021-07-07 18:52:09
C++ / C#
Uncle Bogdan, 2021-07-07 18:52:09

How to check one more variable in .Find()?

In the PlayerBrawlers sheet, you need to find a Brawler who is level 7 and above and the boolean variable Have is False? How to do this and then add such a Brawler to RandomBrawler

// Сейчас проверка только на 7 уровень
                if(player.PlayerBrawlers.Find(item => item.Level >= 7))
                {
                    RandomBrawler = player.PlayerBrawlers.Find(item => item.Level >= 7); // Важно чтобы был не только 7 уровень, но и Have = false
                }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-07-07
@motkot

replaced by

RandomBrawler = player.PlayerBrawlers.FirstOrDefault(item => item.Level >= 7 && item.Have == false);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question