コード例 #1
0
    public static List <CSPersonnel> GetTraineeList()
    {
        CSMgCreator creator = null;

        creator = s_MgCreator;
        List <CSPersonnel> result = new List <CSPersonnel>();

        if (s_MgCreator.Assembly == null)
        {
            return(null);
        }
        CSTraining cst = s_MgCreator.Assembly.TrainingCenter;

        if (cst == null)
        {
            return(null);
        }
        foreach (int id in cst.TraineeList)
        {
            CSPersonnel csp = creator.GetNpc(id);
            if (csp != null)
            {
                result.Add(csp);
            }
        }
        return(result);
    }
コード例 #2
0
    void RPC_S2C_InitDataTrain(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        CSTrainData recordData = (CSTrainData)_ColonyObj._RecordData;

        recordData.m_CurDeleteTime = stream.Read <float>();
        recordData.m_CurRepairTime = stream.Read <float>();
        recordData.m_DeleteTime    = stream.Read <float>();
        recordData.m_Durability    = stream.Read <float>();
        recordData.m_RepairTime    = stream.Read <float>();
        recordData.m_RepairValue   = stream.Read <float>();

        byte[] dataArray = stream.Read <byte[]>();
        CSTraining.ParseData(dataArray, recordData);
    }
コード例 #3
0
    public static int GetTraineeCount()
    {
//        CSMgCreator creator = null;
//        creator = s_MgCreator;
        if (s_MgCreator.Assembly == null)
        {
            return(0);
        }
        CSTraining cst = s_MgCreator.Assembly.TrainingCenter;

        if (cst == null)
        {
            return(0);
        }
        return(cst.TraineeList.Count);
    }
コード例 #4
0
    CSCommon _CreateCommon(int type)
    {
        CSCommon csc = null;

        switch (type)
        {
        case CSConst.etStorage:
            csc = new CSStorage();
            CSStorage css = csc as CSStorage;
            css.m_Info    = CSInfoMgr.m_StorageInfo;
            css.m_Creator = this;
            css.m_Package.ExtendPackage(CSInfoMgr.m_StorageInfo.m_MaxItem, CSInfoMgr.m_StorageInfo.m_MaxEquip, CSInfoMgr.m_StorageInfo.m_MaxRecource, CSInfoMgr.m_StorageInfo.m_MaxArmor);
            break;

        case CSConst.etEnhance:
            csc = new CSEnhance();
            CSEnhance csen = csc as CSEnhance;
            csen.m_Creator = this;
            csen.m_Info    = CSInfoMgr.m_EnhanceInfo;
            break;

        case CSConst.etRepair:
            csc = new CSRepair();
            CSRepair csr = csc as CSRepair;
            csr.m_Creator = this;
            csr.m_Info    = CSInfoMgr.m_RepairInfo;
            break;

        case CSConst.etRecyle:
            csc = new CSRecycle();
            CSRecycle csrc = csc as CSRecycle;
            csrc.m_Creator = this;
            csrc.m_Info    = CSInfoMgr.m_RecycleInfo;
            break;

        case CSConst.etDwelling:
            csc = new CSDwellings();
            CSDwellings csd = csc as CSDwellings;
            csd.m_Creator = this;
            csd.m_Info    = CSInfoMgr.m_DwellingsInfo;

            // Find the npc to live
            if (!PeGameMgr.IsMulti)
            {
                int index = 0;
                foreach (KeyValuePair <int, CSCommon> kvp in m_CommonEntities)
                {
                    if (index >= csd.m_NPCS.Length)
                    {
                        break;
                    }

                    if (kvp.Value.m_Type == CSConst.etDwelling)
                    {
                        CSDwellings dwellings = kvp.Value as CSDwellings;
                        if (dwellings.IsRunning)
                        {
                            continue;
                        }
                        for (int i = 0; i < dwellings.m_NPCS.Length; i++)
                        {
                            if (dwellings.m_NPCS[i] != null)
                            {
                                csd.AddNpcs(dwellings.m_NPCS[i]);
                                dwellings.RemoveNpc(dwellings.m_NPCS[i]);
                                index++;
                            }
                        }
                    }
                }
            }
            break;

        case CSConst.etppCoal:
            csc = new CSPPCoal();
            CSPPCoal cscppc = csc as CSPPCoal;
            cscppc.m_Creator   = this;
            cscppc.m_Power     = 10000;
            cscppc.m_RestPower = 10000;
            cscppc.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etppSolar:
            csc = new CSPPSolar();
            CSPPSolar cspps = csc as CSPPSolar;
            cspps.m_Creator   = this;
            cspps.m_Power     = 10000;
            cspps.m_RestPower = 10000;
            cspps.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etFarm:
            csc           = new CSFarm();
            csc.m_Creator = this;
            csc.m_Info    = CSInfoMgr.m_FarmInfo;
            break;

        case CSConst.etFactory:
            csc           = new CSFactory();
            csc.m_Creator = this;
            csc.m_Info    = CSInfoMgr.m_FactoryInfo;
            break;

        case CSConst.etProcessing:
            csc = new CSProcessing(this);
            CSProcessing csp = csc as CSProcessing;
            csp.m_Info = CSInfoMgr.m_ProcessingInfo;
            break;

        case CSConst.etTrade:
            csc = new CSTrade(this);
            CSTrade cst = csc as CSTrade;
            cst.m_Info = CSInfoMgr.m_Trade;
            break;

        case CSConst.etTrain:
            csc = new CSTraining(this);
            CSTraining cstrain = csc as CSTraining;
            cstrain.m_Info = CSInfoMgr.m_Train;
            break;

        case CSConst.dtCheck:
            csc = new CSMedicalCheck(this);
            CSMedicalCheck csCheck = csc as CSMedicalCheck;
            csCheck.m_Info = CSInfoMgr.m_Check;
            break;

        case CSConst.dtTreat:
            csc = new CSMedicalTreat(this);
            CSMedicalTreat csTreat = csc as CSMedicalTreat;
            csTreat.m_Info = CSInfoMgr.m_Treat;
            break;

        case CSConst.dtTent:
            csc = new CSMedicalTent(this);
            CSMedicalTent csTent = csc as CSMedicalTent;
            csTent.m_Info = CSInfoMgr.m_Tent;
            break;

        case CSConst.dtppFusion:
            csc = new CSPPFusion();
            CSPPFusion csFusion = csc as CSPPFusion;
            csFusion.m_Creator   = this;
            csFusion.m_Power     = 10000;
            csFusion.m_RestPower = 100000;
            csFusion.m_Info      = CSInfoMgr.m_ppFusion;
            break;

        default:
            break;
        }

        return(csc);
    }