예제 #1
0
        public async Task <Nation> GetRecruitableNationAsync(EventId id, bool isAPI)
        {
            bool   found  = false;
            Nation result = null;

            do
            {
                var nation = await NationManager.GetNationByStatusNameAsync("pending");

                if (nation != null)
                {
                    found = await IsNationRecruitableAsync(nation, id);

                    if (found)
                    {
                        result = nation;
                    }
                    else
                    {
                        if (IsReceivingRecruitableNations && !isAPI)
                        {
                            currentRNStatus.SkippedCount++;
                        }
                    }
                }
                else
                {
                    _logger.LogCritical(id, "Picked nation was null !");
                    break;
                }
            } while (!found);
            return(result);
        }