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