WorkResultSlot.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. namespace Schedule
  3. {
  4. public class WorkResultSlot : SlotBase
  5. {
  6. public WorkResultSlot(WorkResultScene rs, int slotId)
  7. {
  8. this.wrs = rs;
  9. this._slotId = slotId;
  10. this.textureBank = rs.textureBank;
  11. this.Update();
  12. }
  13. public override void Update()
  14. {
  15. base.Update();
  16. }
  17. public void InitResultWork(WorkResultSceneMode mode)
  18. {
  19. if (mode == WorkResultSceneMode.Noon)
  20. {
  21. if (this.noonWorksData == null)
  22. {
  23. this.noonWorksData = this.InitResultWork(base.noonWorkId, ResultWorkMgr.ResultType.Daytime);
  24. }
  25. }
  26. else if (mode == WorkResultSceneMode.Night && this.nightWorksData == null)
  27. {
  28. this.nightWorksData = this.InitResultWork(base.nightWorkId, ResultWorkMgr.ResultType.Night);
  29. }
  30. }
  31. private ResultBaseTask InitResultWork(int workId, ResultWorkMgr.ResultType resultType)
  32. {
  33. ResultBaseTask result = null;
  34. if (ScheduleCSVData.AllData.ContainsKey(workId))
  35. {
  36. ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[workId];
  37. ScheduleTaskCtrl.TaskType type = scheduleBase.type;
  38. if (type != ScheduleTaskCtrl.TaskType.Training)
  39. {
  40. if (type != ScheduleTaskCtrl.TaskType.Yotogi)
  41. {
  42. if (type == ScheduleTaskCtrl.TaskType.Work)
  43. {
  44. result = new ResultWorkTask(this, workId, resultType);
  45. }
  46. }
  47. else
  48. {
  49. result = new ResultYotogiTask(this, workId, resultType);
  50. }
  51. }
  52. else
  53. {
  54. result = new ResultTrainingTask(this, workId, resultType);
  55. }
  56. }
  57. return result;
  58. }
  59. protected WorkResultScene wrs;
  60. public ResultBaseTask noonWorksData;
  61. public ResultBaseTask nightWorksData;
  62. }
  63. }