using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using UnityEngine; /// /// 年级 /// public class CollegeVo { public CollegeVo(int id) { this.collegeId = id; } /// /// 部门id /// public int collegeId { get; set; } /// /// 学院名字 /// public string name { get { if (this.collegeMo != null) { return this.collegeMo.name; } return ""; } } /// /// 当前年级下的课程信息 /// public List courseList //{ get; set; } { get { Dictionary>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic; List clist = new List(); if (!ingTaskCardDic.ContainsKey(this.collegeId)) { return clist; } Dictionary> courseDic = ingTaskCardDic[this.collegeId]; foreach (KeyValuePair> kt in courseDic) { CourseVo courseVo = new CourseVo(this.collegeId, kt.Key); clist.Add(courseVo); //Dictionary cardDic = kt.Value; //List taskCardList = new List(); //foreach (KeyValuePair kn in cardDic) //{ // TaskCardDataNewVo cardVo = new TaskCardDataNewVo(this.collegeId, kt.Key, kn.Key); // taskCardList.Add(cardVo); //} //courseVo.taskCardList = taskCardList; //clist.Add(courseVo); } return clist; } } /// /// 年级奖励 /// public List collegePrize { get { if (this.collegeMo == null) { return new List(); } if (this.collegeMo.prize == string.Empty) { return new List(); } List list = this.collegeMo.RealRewards(); return list; } } /// /// 当前年级的所有课程是否完成;完成则点击领取奖励 /// public bool isComplete { get { if (this.collegeMo == null) { return false; } if (this.collegeMo.cList == string.Empty) { return false; } string[] list = GameConfigData.Ins.GetcollegeMo(this.collegeId).cList.Split(','); bool tag = true; foreach (string cid in list) { if (UserProxy.Instance.player.collegeInfo.comCourseList.Contains(int.Parse(cid))) { tag = false; break; } } //if (list.Length == UserProxy.Instance.player.collegeInfo.comCourseList.Count) //{ // return true; //} return tag; } } /// /// 该年级的奖励是否已经领取了 true:是 /// public bool isReceived { get { if (UserProxy.Instance.player.collegeInfo.collegeRewardList.Contains(this.collegeId)) { return true; } return false; } } /// /// 学院mo /// public sm_college collegeMo { get { return GameConfigData.Ins.GetcollegeMo(this.collegeId); } } /// /// 是否完结所有部门的课程 /// public bool isEnd { get { int maskCollege = UserProxy.Instance.player.collegeInfo.maskCollege; if (maskCollege == (int)Enum_College.finish) { return true; } return false; } } } /// /// 课程信息 /// public class CourseVo { public int collegeId { get; set; } /// /// 课程id /// public int courseId { get; set; } /// /// 当前课程名称 /// public string cName { get { return this.courseMo.name; } } /// /// 该课程是否已经完成 /// public bool isComplete { get { if (UserProxy.Instance.player.collegeInfo.comCourseList.Contains(this.courseId)) { return true; } return false; } } /// /// 是否是当前正在进行的课程。是:true;(默认显示正在进行的课程的任务卡其他都不显示) /// //public bool isIngCourse //{ // get // { // Dictionary>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic; // int lastId = 0; // foreach (KeyValuePairkv in ingTaskCardDic) // { // lastId = kv.Value.missCardId; // } // if (lastId == this.courseId) // { // return true; // } // //int curId = UserProxy.Instance.player.collegeInfo.courseId; // //if (curId == this.courseId) // //{ // // return true; // //} // return false; // } //} /// /// 当前课程的任务卡进度 /// public float progress { get { int cur = 0; Dictionary>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic; //Dictionary ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;[this.collegeId][this.courseId]; if (!ingTaskCardDic.ContainsKey(this.collegeId)) { return cur; } if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId)) { return cur; } string[] sList = this.courseMo.misslist.Split(','); foreach (string id in sList) { if (ingTaskCardDic[this.collegeId][this.courseId][id].type == (int)Enum_TaskCardStateType.drawed) { cur += 1; } } //foreach (KeyValuePair kv in UserProxy.Instance.player.collegeInfo.compMissCardDic) //{ // if (kv.Value.type == (int)Enum_TaskCardStateType.drawed) // { // cur += 1; // } //} int max = sList.Length; float per = 1.0f * cur / max; return per; } } /// /// 课程奖励 /// public List coursePrize { get { if (this.courseMo.prize == string.Empty) { return new List(); } List list = this.courseMo.RealRewards(); return list; } } public sm_course courseMo { get { return GameConfigData.Ins.GetcourseMo(this.courseId); } } /// /// 任务卡列表【当前课程下的任务卡,其他没给数据是个空list】 /// /// public List taskCardList //{ get; set; } { get { List taskCardList = new List(); Dictionary>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic; if (!ingTaskCardDic.ContainsKey(this.collegeId)) { return taskCardList; } if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId)) { return taskCardList; } Dictionary cardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId]; //List taskCardList = new List(); foreach (KeyValuePair kn in cardDic) { TaskCardDataVo cardVo = new TaskCardDataVo(this.collegeId, this.courseId, kn.Key); taskCardList.Add(cardVo); } return taskCardList; } } public CourseVo(int collegeId,int cId) { this.courseId = cId; this.collegeId = collegeId; } } /// /// 圣哲学院里的任务卡信息 /// public class TaskCardDataVo { public TaskCardDataVo(int collegeId, int courseId,string taskCardId) { this.collegeId = collegeId; this.courseId = courseId; this.taskCardId = taskCardId; } public int collegeId { get; set; } public int courseId { get; set; } /// /// 任务卡id /// public string taskCardId { get; set; } /// /// 背包里的索引id /// public int taskCardUID { get { Dictionary>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic; if (!ingTaskCardDic.ContainsKey(this.collegeId)) { return 0; } if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId)) { return 0; } return UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId][this.taskCardId].indexId; //return 0; } } /// /// 卡状态 /// public Enum_TaskCardStateType type { get { Dictionary ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId]; Dictionary collectTaskCardDic = UserProxy.Instance.player.collectTaskCard.collectTaskCardDic; if (ingTaskCardDic[this.taskCardId].type == (int)Enum_TaskCardStateType.ing) { if (this.taskCur >= this.taskMax) { //Debug.Log("-----------------------------cccccc"+ this.taskCur+"----" +this.taskMax); return Enum_TaskCardStateType.finish; } } //Debug.Log("-----------------------------hhhhhhhhh"); return (Enum_TaskCardStateType)ingTaskCardDic[this.taskCardId].type; //} return Enum_TaskCardStateType.notopen; } } /// /// 进行中任务的描述信息 /// public string taskCtx { get { return this.taskMo.name; } } /// /// 进行中任务的最大值 /// public int taskMax { get { //Debug.Log("id=====================" + taskCardId + "-------" + this.taskCardUID); //Debug.Log("num=====================" + this.taskMo.num); return this.taskMo.num; } } /// /// 进行中任务的当前值 /// public int taskCur { get { Dictionary collectTaskCardDic = UserProxy.Instance.player.collectTaskCard.collectTaskCardDic; if (collectTaskCardDic.ContainsKey(this.taskCardUID.ToString())) { List curSteps = collectTaskCardDic[this.taskCardUID.ToString()].curSteps; return curSteps[0].cur; } //if (type == Enum_TaskCardStateType.ing || type == Enum_TaskCardStateType.finish) //{ // List curSteps = collectTaskCardDic[this.taskCardUID.ToString()].curSteps; // Debug.Log("cur=====================" + curSteps[0].cur); // return curSteps[0].cur; //} return 0; } } /// /// 奖励vo /// public List itemVo { get { if (this.taskCardMo.reward == string.Empty) { return new List(); } List list = this.taskCardMo.RealRewards(); return list; } } /// /// 任务卡Mo /// public sm_item_taskcard taskCardMo { get { return GameConfigData.Ins.Getitem_taskcardMo(int.Parse(this.taskCardId)); } } /// /// 任务Mo /// public sm_task_step taskMo { get { return GameConfigData.Ins.Gettask_stepMo(int.Parse(this.taskCardMo.tasksteps)); } } }