Exemple #1
0
    private void CollectChapterData()
    {
        campaignsNormal = new List <DataCampaign> ();
        campaignsElite  = new List <DataCampaign> ();

        foreach (DataMission m in dataMissions.Values)
        {
            List <DataCampaign> targetCampaigns = GetCampaigns(m.difficulty);

            int          stageIndex = m.stageId - 1;
            DataCampaign targetCampaign;
            if (targetCampaigns.Count > stageIndex)
            {
                targetCampaign = targetCampaigns[stageIndex];
            }
            else
            {
                Assert.assert(stageIndex == targetCampaigns.Count, "stageId is not continuous = " + m.stageId);

                targetCampaign = new DataCampaign(m.difficulty, m.stageId);
                targetCampaigns.Add(targetCampaign);
            }

            int missionIndex = m.missionId - 1;
            Assert.assert(targetCampaign.missions.Count == missionIndex);
            targetCampaign.missions.Add(m);
        }
    }
Exemple #2
0
    public DataMission GetMission(DataConfig.MISSION_DIFFICULTY difficulty, int stageId, int missionId)
    {
        DataCampaign campaign = GetCampaign(difficulty, stageId);

        return(campaign.missions[missionId - 1]);
    }