private static STActivityInfo ConvertToSTActivity(mw.ActivityConfig config) { STActivityInfo act = new STActivityInfo(); act.id = config.id; List <mw.AchieveConfig> listAchieve = GMTActivityMananger.GetAchieveConfigsByActivityId(act.id); if (listAchieve.Count == 0) { return(null); } int titleTextId = listAchieve[0].name; act.title = TextManager.GetText(titleTextId); int descTextId = listAchieve[0].txt; act.desc = TextManager.GetText(descTextId); act.firstmark = (config.NeedFlag == 1); act.order = config.sortvalue; act.quests = new List <STQuestInfo>(); foreach (var AchieveConfig in listAchieve) { STQuestInfo quest = ConvertToSTQuest(AchieveConfig); act.quests.Add(quest); } return(act); }
private static STQuestInfo ConvertToSTQuest(mw.AchieveConfig config) { STQuestInfo quest = new STQuestInfo(); quest.type = (int)config.type; quest.typename = GetQuestTypeName(quest.type); quest.desc = TextManager.GetText(config.desc); quest.overlap = (config.taskFlag == 1); quest.request = config.opt_type_1; quest.requestname = GetRequestName(quest.request); quest.count_a = config.opt_val_1_a; quest.count_b = config.opt_val_1_b; quest.count_c = config.opt_val_1_c; mw.RewardConfig configReward = GMTActivityMananger.GetRewardConfigsById(config.reward); if (null != configReward) { ConvertToSTReward(configReward, out quest.rewards); } return(quest); }