示例#1
0
        public static List <Fellow> FellowCanBreedingFilter(FellowContainer container)
        {
            List <Fellow> resultList = new List <Fellow>();

            for (int i = 0; i < container.ContainerSize; i++)
            {
                Fellow fellow = container.GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && false == fellow.Called && fellow.IsBabyFellow() && fellow.ProcreateCount >= 1)
                {
                    resultList.Add(container.GetFellowByIndex(i));
                }
            }
            return(resultList);
        }
示例#2
0
        public static List <Fellow> FellowBabyFilter(FellowContainer container)
        {
            List <Fellow> resultList = new List <Fellow>();

            for (int i = 0; i < container.ContainerSize; i++)
            {
                Fellow fellow = container.GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && fellow.IsBabyFellow())
                {
                    resultList.Add(container.GetFellowByIndex(i));
                }
            }
            return(resultList);
        }
示例#3
0
        public static List <Fellow> FellowSort(FellowContainer container)
        {
            List <Fellow> resultList = new List <Fellow>();

            for (int i = 0; i < container.ContainerSize; i++)
            {
                if (container.GetFellowByIndex(i) != null && container.GetFellowByIndex(i).IsValid())
                {
                    resultList.Add(container.GetFellowByIndex(i));
                }
            }

            for (int i = 0; i < resultList.Count; i++)
            {
                int flag = 0;
                for (int j = 0; j < (resultList.Count - i - 1); j++)
                {
                    //当前召出伙伴排前面
                    if (resultList[j + 1].Called)
                    {
                        Fellow tempFellow = resultList[j + 1];
                        resultList[j + 1] = resultList[j];
                        resultList[j]     = tempFellow;
                        flag = 1;
                    }
                    else if (resultList[j].Called == false)
                    {
                        //星级高的伙伴排前面
                        if (resultList[j + 1].StarLevel > resultList[j].StarLevel)
                        {
                            Fellow tempFellow = resultList[j + 1];
                            resultList[j + 1] = resultList[j];
                            resultList[j]     = tempFellow;
                            flag = 1;
                        }
                        else if (resultList[j + 1].StarLevel == resultList[j].StarLevel)
                        {
                            //品质高的排前面
                            if (resultList[j + 1].Quality > resultList[j].Quality)
                            {
                                Fellow tempFellow = resultList[j + 1];
                                resultList[j + 1] = resultList[j];
                                resultList[j]     = tempFellow;
                                flag = 1;
                            }
                            else if (resultList[j + 1].Quality == resultList[j].Quality)
                            {
                                //等级高的排前面
                                if (resultList[j + 1].Level > resultList[j].Level)
                                {
                                    Fellow tempFellow = resultList[j + 1];
                                    resultList[j + 1] = resultList[j];
                                    resultList[j]     = tempFellow;
                                    flag = 1;
                                }
                                else if (resultList[j + 1].Level == resultList[j].Level)
                                {
                                    //DataId大的排前面
                                    if (resultList[j + 1].DataId > resultList[j].DataId)
                                    {
                                        Fellow tempFellow = resultList[j + 1];
                                        resultList[j + 1] = resultList[j];
                                        resultList[j]     = tempFellow;
                                        flag = 1;
                                    }
                                    else if (resultList[j + 1].DataId == resultList[j].DataId)
                                    {
                                        //Guid大的排前面
                                        if (resultList[j + 1].Guid > resultList[j].Guid)
                                        {
                                            Fellow tempFellow = resultList[j + 1];
                                            resultList[j + 1] = resultList[j];
                                            resultList[j]     = tempFellow;
                                            flag = 1;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (flag == 0)
                {
                    break;
                }
            }

            return(resultList);
        }