CollegeVo.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Collections;
  6. using UnityEngine;
  7. /// <summary>
  8. /// 年级
  9. /// </summary>
  10. public class CollegeVo
  11. {
  12. public CollegeVo(int id)
  13. {
  14. this.collegeId = id;
  15. }
  16. /// <summary>
  17. /// 部门id
  18. /// </summary>
  19. public int collegeId { get; set; }
  20. /// <summary>
  21. /// 学院名字
  22. /// </summary>
  23. public string name
  24. {
  25. get
  26. {
  27. if (this.collegeMo != null)
  28. {
  29. return this.collegeMo.name;
  30. }
  31. return "";
  32. }
  33. }
  34. /// <summary>
  35. /// 当前年级下的课程信息
  36. /// </summary>
  37. public List<CourseVo> courseList //{ get; set; }
  38. {
  39. get
  40. {
  41. Dictionary<int, Dictionary<int, Dictionary<string, missCourseItem>>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;
  42. List<CourseVo> clist = new List<CourseVo>();
  43. if (!ingTaskCardDic.ContainsKey(this.collegeId))
  44. {
  45. return clist;
  46. }
  47. Dictionary<int, Dictionary<string, missCourseItem>> courseDic = ingTaskCardDic[this.collegeId];
  48. foreach (KeyValuePair<int, Dictionary<string, missCourseItem>> kt in courseDic)
  49. {
  50. CourseVo courseVo = new CourseVo(this.collegeId, kt.Key);
  51. clist.Add(courseVo);
  52. //Dictionary<string, missCourseItem> cardDic = kt.Value;
  53. //List<TaskCardDataNewVo> taskCardList = new List<TaskCardDataNewVo>();
  54. //foreach (KeyValuePair<string, missCourseItem> kn in cardDic)
  55. //{
  56. // TaskCardDataNewVo cardVo = new TaskCardDataNewVo(this.collegeId, kt.Key, kn.Key);
  57. // taskCardList.Add(cardVo);
  58. //}
  59. //courseVo.taskCardList = taskCardList;
  60. //clist.Add(courseVo);
  61. }
  62. return clist;
  63. }
  64. }
  65. /// <summary>
  66. /// 年级奖励
  67. /// </summary>
  68. public List<ItemVo> collegePrize
  69. {
  70. get
  71. {
  72. if (this.collegeMo == null)
  73. {
  74. return new List<ItemVo>();
  75. }
  76. if (this.collegeMo.prize == string.Empty)
  77. {
  78. return new List<ItemVo>();
  79. }
  80. List<ItemVo> list = this.collegeMo.RealRewards();
  81. return list;
  82. }
  83. }
  84. /// <summary>
  85. /// 当前年级的所有课程是否完成;完成则点击领取奖励
  86. /// </summary>
  87. public bool isComplete
  88. {
  89. get
  90. {
  91. if (this.collegeMo == null)
  92. {
  93. return false;
  94. }
  95. if (this.collegeMo.cList == string.Empty)
  96. {
  97. return false;
  98. }
  99. string[] list = GameConfigData.Ins.GetcollegeMo(this.collegeId).cList.Split(',');
  100. bool tag = true;
  101. foreach (string cid in list)
  102. {
  103. if (UserProxy.Instance.player.collegeInfo.comCourseList.Contains(int.Parse(cid)))
  104. {
  105. tag = false;
  106. break;
  107. }
  108. }
  109. //if (list.Length == UserProxy.Instance.player.collegeInfo.comCourseList.Count)
  110. //{
  111. // return true;
  112. //}
  113. return tag;
  114. }
  115. }
  116. /// <summary>
  117. /// 该年级的奖励是否已经领取了 true:是
  118. /// </summary>
  119. public bool isReceived
  120. {
  121. get
  122. {
  123. if (UserProxy.Instance.player.collegeInfo.collegeRewardList.Contains(this.collegeId))
  124. {
  125. return true;
  126. }
  127. return false;
  128. }
  129. }
  130. /// <summary>
  131. /// 学院mo
  132. /// </summary>
  133. public sm_college collegeMo
  134. {
  135. get
  136. {
  137. return GameConfigData.Ins.GetcollegeMo(this.collegeId);
  138. }
  139. }
  140. /// <summary>
  141. /// 是否完结所有部门的课程
  142. /// </summary>
  143. public bool isEnd
  144. {
  145. get
  146. {
  147. int maskCollege = UserProxy.Instance.player.collegeInfo.maskCollege;
  148. if (maskCollege == (int)Enum_College.finish)
  149. {
  150. return true;
  151. }
  152. return false;
  153. }
  154. }
  155. }
  156. /// <summary>
  157. /// 课程信息
  158. /// </summary>
  159. public class CourseVo
  160. {
  161. public int collegeId { get; set; }
  162. /// <summary>
  163. /// 课程id
  164. /// </summary>
  165. public int courseId { get; set; }
  166. /// <summary>
  167. /// 当前课程名称
  168. /// </summary>
  169. public string cName
  170. {
  171. get
  172. {
  173. return this.courseMo.name;
  174. }
  175. }
  176. /// <summary>
  177. /// 该课程是否已经完成
  178. /// </summary>
  179. public bool isComplete
  180. {
  181. get
  182. {
  183. if (UserProxy.Instance.player.collegeInfo.comCourseList.Contains(this.courseId))
  184. {
  185. return true;
  186. }
  187. return false;
  188. }
  189. }
  190. /// <summary>
  191. /// 是否是当前正在进行的课程。是:true;(默认显示正在进行的课程的任务卡其他都不显示)
  192. /// </summary>
  193. //public bool isIngCourse
  194. //{
  195. // get
  196. // {
  197. // Dictionary<int, Dictionary<int, Dictionary<int, missCourseItem>>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;
  198. // int lastId = 0;
  199. // foreach (KeyValuePair<int, missCourseItem>kv in ingTaskCardDic)
  200. // {
  201. // lastId = kv.Value.missCardId;
  202. // }
  203. // if (lastId == this.courseId)
  204. // {
  205. // return true;
  206. // }
  207. // //int curId = UserProxy.Instance.player.collegeInfo.courseId;
  208. // //if (curId == this.courseId)
  209. // //{
  210. // // return true;
  211. // //}
  212. // return false;
  213. // }
  214. //}
  215. /// <summary>
  216. /// 当前课程的任务卡进度
  217. /// </summary>
  218. public float progress
  219. {
  220. get
  221. {
  222. int cur = 0;
  223. Dictionary<int, Dictionary<int, Dictionary<string, missCourseItem>>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;
  224. //Dictionary<string, missCourseItem> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;[this.collegeId][this.courseId];
  225. if (!ingTaskCardDic.ContainsKey(this.collegeId))
  226. {
  227. return cur;
  228. }
  229. if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId))
  230. {
  231. return cur;
  232. }
  233. string[] sList = this.courseMo.misslist.Split(',');
  234. foreach (string id in sList)
  235. {
  236. if (ingTaskCardDic[this.collegeId][this.courseId][id].type == (int)Enum_TaskCardStateType.drawed)
  237. {
  238. cur += 1;
  239. }
  240. }
  241. //foreach (KeyValuePair<int, missCourseItem> kv in UserProxy.Instance.player.collegeInfo.compMissCardDic)
  242. //{
  243. // if (kv.Value.type == (int)Enum_TaskCardStateType.drawed)
  244. // {
  245. // cur += 1;
  246. // }
  247. //}
  248. int max = sList.Length;
  249. float per = 1.0f * cur / max;
  250. return per;
  251. }
  252. }
  253. /// <summary>
  254. /// 课程奖励
  255. /// </summary>
  256. public List<ItemVo> coursePrize
  257. {
  258. get
  259. {
  260. if (this.courseMo.prize == string.Empty)
  261. {
  262. return new List<ItemVo>();
  263. }
  264. List<ItemVo> list = this.courseMo.RealRewards();
  265. return list;
  266. }
  267. }
  268. public sm_course courseMo
  269. {
  270. get
  271. {
  272. return GameConfigData.Ins.GetcourseMo(this.courseId);
  273. }
  274. }
  275. /// <summary>
  276. /// 任务卡列表【当前课程下的任务卡,其他没给数据是个空list】
  277. /// </summary>
  278. /// <returns></returns>
  279. public List<TaskCardDataVo> taskCardList //{ get; set; }
  280. {
  281. get
  282. {
  283. List<TaskCardDataVo> taskCardList = new List<TaskCardDataVo>();
  284. Dictionary<int, Dictionary<int, Dictionary<string, missCourseItem>>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;
  285. if (!ingTaskCardDic.ContainsKey(this.collegeId))
  286. {
  287. return taskCardList;
  288. }
  289. if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId))
  290. {
  291. return taskCardList;
  292. }
  293. Dictionary<string, missCourseItem> cardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId];
  294. //List<TaskCardDataVo> taskCardList = new List<TaskCardDataVo>();
  295. foreach (KeyValuePair<string, missCourseItem> kn in cardDic)
  296. {
  297. TaskCardDataVo cardVo = new TaskCardDataVo(this.collegeId, this.courseId, kn.Key);
  298. taskCardList.Add(cardVo);
  299. }
  300. return taskCardList;
  301. }
  302. }
  303. public CourseVo(int collegeId,int cId)
  304. {
  305. this.courseId = cId;
  306. this.collegeId = collegeId;
  307. }
  308. }
  309. /// <summary>
  310. /// 圣哲学院里的任务卡信息
  311. /// </summary>
  312. public class TaskCardDataVo
  313. {
  314. public TaskCardDataVo(int collegeId, int courseId,string taskCardId)
  315. {
  316. this.collegeId = collegeId;
  317. this.courseId = courseId;
  318. this.taskCardId = taskCardId;
  319. }
  320. public int collegeId { get; set; }
  321. public int courseId { get; set; }
  322. /// <summary>
  323. /// 任务卡id
  324. /// </summary>
  325. public string taskCardId { get; set; }
  326. /// <summary>
  327. /// 背包里的索引id
  328. /// </summary>
  329. public int taskCardUID
  330. {
  331. get
  332. {
  333. Dictionary<int, Dictionary<int, Dictionary<string, missCourseItem>>> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic;
  334. if (!ingTaskCardDic.ContainsKey(this.collegeId))
  335. {
  336. return 0;
  337. }
  338. if (!ingTaskCardDic[this.collegeId].ContainsKey(this.courseId))
  339. {
  340. return 0;
  341. }
  342. return UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId][this.taskCardId].indexId;
  343. //return 0;
  344. }
  345. }
  346. /// <summary>
  347. /// 卡状态
  348. /// </summary>
  349. public Enum_TaskCardStateType type
  350. {
  351. get
  352. {
  353. Dictionary<string, missCourseItem> ingTaskCardDic = UserProxy.Instance.player.collegeInfo.ingTaskCardDic[this.collegeId][this.courseId];
  354. Dictionary<string, TaskCardVo> collectTaskCardDic = UserProxy.Instance.player.collectTaskCard.collectTaskCardDic;
  355. if (ingTaskCardDic[this.taskCardId].type == (int)Enum_TaskCardStateType.ing)
  356. {
  357. if (this.taskCur >= this.taskMax)
  358. {
  359. //Debug.Log("-----------------------------cccccc"+ this.taskCur+"----" +this.taskMax);
  360. return Enum_TaskCardStateType.finish;
  361. }
  362. }
  363. //Debug.Log("-----------------------------hhhhhhhhh");
  364. return (Enum_TaskCardStateType)ingTaskCardDic[this.taskCardId].type;
  365. //}
  366. return Enum_TaskCardStateType.notopen;
  367. }
  368. }
  369. /// <summary>
  370. /// 进行中任务的描述信息
  371. /// </summary>
  372. public string taskCtx
  373. {
  374. get
  375. {
  376. return this.taskMo.name;
  377. }
  378. }
  379. /// <summary>
  380. /// 进行中任务的最大值
  381. /// </summary>
  382. public int taskMax
  383. {
  384. get
  385. {
  386. //Debug.Log("id=====================" + taskCardId + "-------" + this.taskCardUID);
  387. //Debug.Log("num=====================" + this.taskMo.num);
  388. return this.taskMo.num;
  389. }
  390. }
  391. /// <summary>
  392. /// 进行中任务的当前值
  393. /// </summary>
  394. public int taskCur
  395. {
  396. get
  397. {
  398. Dictionary<string, TaskCardVo> collectTaskCardDic = UserProxy.Instance.player.collectTaskCard.collectTaskCardDic;
  399. if (collectTaskCardDic.ContainsKey(this.taskCardUID.ToString()))
  400. {
  401. List<Ins_TaskStepVo> curSteps = collectTaskCardDic[this.taskCardUID.ToString()].curSteps;
  402. return curSteps[0].cur;
  403. }
  404. //if (type == Enum_TaskCardStateType.ing || type == Enum_TaskCardStateType.finish)
  405. //{
  406. // List<TaskStepVo> curSteps = collectTaskCardDic[this.taskCardUID.ToString()].curSteps;
  407. // Debug.Log("cur=====================" + curSteps[0].cur);
  408. // return curSteps[0].cur;
  409. //}
  410. return 0;
  411. }
  412. }
  413. /// <summary>
  414. /// 奖励vo
  415. /// </summary>
  416. public List<ItemVo> itemVo
  417. {
  418. get
  419. {
  420. if (this.taskCardMo.reward == string.Empty)
  421. {
  422. return new List<ItemVo>();
  423. }
  424. List<ItemVo> list = this.taskCardMo.RealRewards();
  425. return list;
  426. }
  427. }
  428. /// <summary>
  429. /// 任务卡Mo
  430. /// </summary>
  431. public sm_item_taskcard taskCardMo
  432. {
  433. get
  434. {
  435. return GameConfigData.Ins.Getitem_taskcardMo(int.Parse(this.taskCardId));
  436. }
  437. }
  438. /// <summary>
  439. /// 任务Mo
  440. /// </summary>
  441. public sm_task_step taskMo
  442. {
  443. get
  444. {
  445. return GameConfigData.Ins.Gettask_stepMo(int.Parse(this.taskCardMo.tasksteps));
  446. }
  447. }
  448. }