using System;
using System.Collections.Generic;

namespace Schedule
{
	public class Slot : SlotBase
	{
		public Slot(ScheduleScene ss, int slotId)
		{
			this.ss = ss;
			this._slotId = slotId;
			this.textureBank = ss.textureBank;
			this.Update();
		}

		public List<ScheduleBase> scheduleData
		{
			get
			{
				List<ScheduleBase> list = new List<ScheduleBase>();
				list.AddRange(this.noonWorksData);
				return list;
			}
		}

		public override void Update()
		{
			base.Update();
			this.noonWorksData = new List<ScheduleBase>();
			this.nightWorksData = new List<ScheduleBase>();
			foreach (KeyValuePair<int, ScheduleCSVData.ScheduleBase> keyValuePair in ScheduleCSVData.AllData)
			{
				if (keyValuePair.Value.type == ScheduleTaskCtrl.TaskType.Training)
				{
					this.noonWorksData.Add(new ScheduleTraining(ScheduleType.Training, this, keyValuePair.Key));
				}
				else if (keyValuePair.Value.type == ScheduleTaskCtrl.TaskType.Yotogi)
				{
					this.noonWorksData.Add(new ScheduleYotogi(ScheduleType.Yotogi, this, keyValuePair.Key));
				}
				else if (keyValuePair.Value.type == ScheduleTaskCtrl.TaskType.Work)
				{
					this.noonWorksData.Add(new ScheduleWork(ScheduleType.Work, this, keyValuePair.Key));
				}
			}
		}

		protected ScheduleScene ss;

		public List<ScheduleBase> noonWorksData;

		public List<ScheduleBase> nightWorksData;
	}
}
