TrainingTaskUnit.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using Schedule;
  3. public class TrainingTaskUnit : TaskUnit
  4. {
  5. public ScheduleCSVData.Training training { get; private set; }
  6. public void SetData(ScheduleTaskViewer viewer, ScheduleTaskViewer.ViewData viewData)
  7. {
  8. base.SetData(ScheduleTaskCtrl.TaskType.Training, viewer, viewData);
  9. this.training = (ScheduleCSVData.Training)viewData.schedule;
  10. ScheduleTaskCtrl.TrainingTaskButton trainingTaskButton = (ScheduleTaskCtrl.TrainingTaskButton)viewData.taskButton;
  11. base.SetTaskRank(base.gameObject, trainingTaskButton.rank);
  12. base.SetExpRatio(base.gameObject, trainingTaskButton.expRatio);
  13. }
  14. public static void AddFacility(Maid maid, ScheduleCSVData.Training training, ScheduleMgr.ScheduleTime time)
  15. {
  16. if (DailyMgr.IsLegacy)
  17. {
  18. return;
  19. }
  20. if (training.trainingType != ScheduleCSVData.TrainingType.Basic)
  21. {
  22. return;
  23. }
  24. Facility[] facilityArray = GameMain.Instance.FacilityMgr.GetFacilityArray();
  25. foreach (Facility facility in facilityArray)
  26. {
  27. if (facility.defaultData.ID == training.facilityId)
  28. {
  29. facility.AllocationMaid(maid, time);
  30. return;
  31. }
  32. }
  33. }
  34. }