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); }
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); }
//宠物红点提示 public void UpdateFellowRedTip() { PlayerData playerdata = GameManager.gameManager.PlayerDataPool; Games.Fellow.FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (playerdata != null && m_PartnerCountTip != null && container != null) { if (container.GetPartnerCanLearnSkill().Count > 0 || container.GetPartnerCanUpdateSkill().Count > 0 || (playerdata.IsProcreateGoing() && playerdata.IsProcreateWaitReceive())) { m_PartnerCountTip.gameObject.SetActive(true); } else { m_PartnerCountTip.gameObject.SetActive(false); } } }
public void UpdateFellowTip() { Games.Fellow.FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; //if (m_PartnerListGrid != null&&m_CurTab == TABCONTENT.TABCONTENT_DEVELOP) if (m_PartnerListGrid != null) { Dictionary <int, List <int> > learnlist = container.GetPartnerCanLearnSkill(); Dictionary <int, List <int> > updatelist = container.GetPartnerCanUpdateSkill(); PartnerFrameItemLogic[] partners = m_PartnerListGrid.GetComponentsInChildren <PartnerFrameItemLogic>(); foreach (PartnerFrameItemLogic pfil in partners) { if (pfil.FellowInfo == null) { continue; } if (learnlist.ContainsKey(pfil.FellowInfo.DataId) || updatelist.ContainsKey(pfil.FellowInfo.DataId)) { pfil.SetRedPoint(true); } else { pfil.SetRedPoint(false); } if (pfil.FellowInfo.Guid == mCurFellowId) { OnItemClick(pfil.FellowInfo); } } } PlayerData playerdata = GameManager.gameManager.PlayerDataPool; if (playerdata != null && CloneRedTip != null) { if (playerdata.IsProcreateGoing() && playerdata.IsProcreateWaitReceive()) { CloneRedTip.SetActive(true); } else { CloneRedTip.SetActive(false); } } }
public void OnItemClick(Fellow fellow) { if (fellow != null && SkillRedTip != null) { Games.Fellow.FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; Dictionary <int, List <int> > learnlist = container.GetPartnerCanLearnSkill(); Dictionary <int, List <int> > updatelist = container.GetPartnerCanUpdateSkill(); if (learnlist.ContainsKey(fellow.DataId) || updatelist.ContainsKey(fellow.DataId)) { SkillRedTip.SetActive(true); } else { SkillRedTip.SetActive(false); } List <int> skills; if (updatelist.TryGetValue(fellow.DataId, out skills)) { foreach (GameObject go in SkillElementsUpdate) { if (go != null) { go.SetActive(false); } } int count = skills.Count; for (int i = 0; i < count; ++i) { if (skills[i] > -1 && skills[i] < SkillElementsUpdate.Length) { SkillElementsUpdate[skills[i]].SetActive(true); } } } } }
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); }