コード例 #1
0
    private NkSoldierInfo FindSolInfo(long solID)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null || NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            return(null);
        }
        NrSoldierList  soldierList  = charPersonInfo.GetSoldierList();
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = soldierList.GetSoldierInfo(i);
            if (soldierInfo != null && soldierInfo.IsValid())
            {
                if (solID == soldierInfo.GetSolID())
                {
                    return(soldierInfo);
                }
            }
        }
        foreach (NkSoldierInfo current in readySolList.GetList().Values)
        {
            if (current != null && current.IsValid())
            {
                if (solID == current.GetSolID())
                {
                    return(current);
                }
            }
        }
        return(null);
    }
コード例 #2
0
    public bool FindSolInfo(int i32CharKind)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null || NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            return(false);
        }
        NrSoldierList  soldierList  = charPersonInfo.GetSoldierList();
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = soldierList.GetSoldierInfo(i);
            if (soldierInfo != null && soldierInfo.IsValid())
            {
                if (soldierInfo.GetCharKind() == i32CharKind)
                {
                    return(true);
                }
            }
        }
        foreach (NkSoldierInfo current in readySolList.GetList().Values)
        {
            if (current != null && current.IsValid())
            {
                if (current.GetCharKind() == i32CharKind)
                {
                    return(true);
                }
            }
        }
        return(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetWarehouseSolList().GetSolWarehouseCharKind(i32CharKind));
    }
コード例 #3
0
    public void CheckInjurySoldierList()
    {
        List <NkSoldierInfo> list           = new List <NkSoldierInfo>();
        List <NkSoldierInfo> list2          = new List <NkSoldierInfo>();
        NrPersonInfoUser     charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null || NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            return;
        }
        NrSoldierList  soldierList  = charPersonInfo.GetSoldierList();
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        list.Clear();
        list2.Clear();
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = soldierList.GetSoldierInfo(i);
            this.AddSolList(soldierInfo, eSOL_POSTYPE.SOLPOS_BATTLE, list);
        }
        foreach (NkSoldierInfo current in readySolList.GetList().Values)
        {
            this.AddSolList(current, eSOL_POSTYPE.SOLPOS_READY, list2);
        }
        int num = 0;

        for (int j = 0; j < list.Count; j++)
        {
            if (list[j] != null)
            {
                if (list[j].IsSolStatus(2))
                {
                    num++;
                }
            }
        }
        this.nInjuryBattleSoldierCount = num;
        num = 0;
        for (int k = 0; k < list2.Count; k++)
        {
            if (list2[k] != null)
            {
                if (list2[k].IsSolStatus(2))
                {
                    if (list2[k].IsInjuryStatus())
                    {
                        num++;
                    }
                }
            }
        }
        this.nInjuryReadySoldierCount = num;
        this.nInjurySoldierCount      = this.nInjuryBattleSoldierCount + this.nInjuryReadySoldierCount;
    }
コード例 #4
0
    private void CollectSolInfo()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null || NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            return;
        }
        NrSoldierList  soldierList  = charPersonInfo.GetSoldierList();
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        if (!ExplorationDlg.m_bSortSolInfo)
        {
            for (int i = NrTSingleton <ExplorationManager> .Instance.GetSolInfo().Count; i < 6; i++)
            {
                NkSoldierInfo soldierInfo = soldierList.GetSoldierInfo(i);
                if (this.IsValidSol(soldierInfo, true))
                {
                    NrTSingleton <ExplorationManager> .Instance.AddSolInfo(soldierInfo);
                }
            }
            foreach (NkSoldierInfo current in readySolList.GetList().Values)
            {
                if (this.IsValidSol(current, true))
                {
                    if (6 <= NrTSingleton <ExplorationManager> .Instance.GetSolInfo().Count)
                    {
                        break;
                    }
                    NrTSingleton <ExplorationManager> .Instance.AddSolInfo(current);
                }
            }
            NrTSingleton <ExplorationManager> .Instance.SortSolInfo();

            if (6 < NrTSingleton <ExplorationManager> .Instance.GetSolInfo().Count)
            {
                NrTSingleton <ExplorationManager> .Instance.GetSolInfo().RemoveRange(6, NrTSingleton <ExplorationManager> .Instance.GetSolInfo().Count - 6);
            }
            ExplorationDlg.m_bSortSolInfo = true;
        }
        else
        {
            for (int j = 0; j < NrTSingleton <ExplorationManager> .Instance.GetSolInfo().Count; j++)
            {
                long solID = NrTSingleton <ExplorationManager> .Instance.GetSolID(j);

                NkSoldierInfo pkSolinfo = this.FindSolInfo(solID);
                if (!this.IsValidSol(pkSolinfo, false))
                {
                    NrTSingleton <ExplorationManager> .Instance.RemoveSolInfo(solID);
                }
            }
        }
    }