using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using FacilityFlag;
using UnityEngine;

public class EmpireLifeModeManager : MonoBehaviour
{
	public List<EmpireLifeModeManager.EventDataObject> nowEventList
	{
		get
		{
			return this.m_EventList;
		}
	}

	public Dictionary<Facility, List<Maid>> nowMaidAllocationDic
	{
		get
		{
			return this.m_NowMaidAllocationDic;
		}
	}

	public List<EmpireLifeModeManager.EventDataObject> executedEventList
	{
		get
		{
			return this.m_ExecutedEventList;
		}
	}

	public List<Maid> lifeModeAllMaidList
	{
		get
		{
			return this.m_LifeModeAllMaidList;
		}
	}

	public void SetAllMaidList(IEnumerable<Maid> maidCorrection)
	{
		this.m_LifeModeAllMaidList = new List<Maid>(maidCorrection);
	}

	public void UpdateAllMaidList()
	{
		this.m_LifeModeAllMaidList = new List<Maid>(from maid in this.m_LifeModeAllMaidList
		where maid != null
		select maid);
	}

	public List<Maid> executedMaidList
	{
		get
		{
			return this.m_ExecutedMaidList;
		}
	}

	private void CreateAndCacheEvent(EmpireLifeModeData.Data data, Facility targetFacility, IEnumerable<Maid> targetMaidList)
	{
		EmpireLifeModeManager.EventDataObject eventDataObject = new EmpireLifeModeManager.EventDataObject();
		eventDataObject.targetEvent = data;
		eventDataObject.targetFacility = targetFacility;
		eventDataObject.targetMaidList = new List<Maid>(targetMaidList);
		this.nowEventList.Add(eventDataObject);
	}

	public void CreateStoryEvent()
	{
		if (this.nowEventList.Exists((EmpireLifeModeManager.EventDataObject d) => d.targetEvent.dataScenarioType == EmpireLifeModeData.ScenarioType.スト\u30FCリ\u30FC))
		{
			Debug.Log("既にストーリーイベントが存在していたので、ストーリーイベントの追加は行いません。");
			return;
		}
		if (this.executedEventList.Exists((EmpireLifeModeManager.EventDataObject d) => d.targetEvent.dataScenarioType == EmpireLifeModeData.ScenarioType.スト\u30FCリ\u30FC))
		{
			Debug.Log("既にストーリーイベントは実行された後なので、ストーリーイベントの追加は行いません。");
			return;
		}
		List<EmpireLifeModeData.Data> datas = EmpireLifeModeData.GetDatas((EmpireLifeModeData.Data d) => EmpireLifeModeData.IsEnabled(d.ID) && d.dataScenarioType == EmpireLifeModeData.ScenarioType.スト\u30FCリ\u30FC, true);
		if (datas == null || datas.Count <= 0)
		{
			Debug.Log("種類が「ストーリー」であるイベントは存在しなかった。");
			return;
		}
		foreach (EmpireLifeModeData.Data data in datas)
		{
			if (data.IsCorrectScenarioAnyNumberPlay())
			{
				if (data.IsCorrectUniqueComparisonObject())
				{
					List<Facility> correctFacilityList = data.GetCorrectFacilityList();
					if (correctFacilityList != null && correctFacilityList.Count > 0)
					{
						List<Maid> list;
						if (EmpireLifeModeManager.TryGetMaidListOfEventData(data, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
						{
							Facility facility = correctFacilityList[UnityEngine.Random.Range(0, correctFacilityList.Count)];
							this.CreateAndCacheEvent(data, facility, list);
							if (!this.nowMaidAllocationDic.ContainsKey(facility))
							{
								this.nowMaidAllocationDic.Add(facility, new List<Maid>());
							}
							this.nowMaidAllocationDic[facility].AddRange(list);
							break;
						}
					}
				}
			}
		}
	}

	public void CreateRandomEventOfNowState()
	{
		Debug.Log("イベント基準で何かしらのイベントを作成します。");
		List<EmpireLifeModeData.Data> datas = EmpireLifeModeData.GetDatas((EmpireLifeModeData.Data data) => data.IsCorrectUniqueComparisonObject() && data.dataScenarioType != EmpireLifeModeData.ScenarioType.スト\u30FCリ\u30FC && data.dataMaidPersonalUniqueNameAndActiveSlotDic.Count > 1 && !this.nowEventList.Exists((EmpireLifeModeManager.EventDataObject d) => d.targetEvent.ID == data.ID) && !this.executedEventList.Exists((EmpireLifeModeManager.EventDataObject d) => d.targetEvent.ID == data.ID), true);
		IOrderedEnumerable<EmpireLifeModeData.Data> orderedEnumerable = from d in datas
		orderby d.dataMaidPersonalUniqueNameAndActiveSlotDic.Count descending, this.GetScenarioExecuteCount(d.ID)
		select d;
		foreach (EmpireLifeModeData.Data data2 in orderedEnumerable)
		{
			List<Facility> correctFacilityList = data2.GetCorrectFacilityList();
			foreach (KeyValuePair<Facility, List<Maid>> keyValuePair in this.nowMaidAllocationDic)
			{
				if (correctFacilityList.Contains(keyValuePair.Key) && 3 - keyValuePair.Value.Count < data2.dataMaidPersonalUniqueNameAndActiveSlotDic.Count)
				{
					correctFacilityList.Remove(keyValuePair.Key);
				}
			}
			if (correctFacilityList != null && correctFacilityList.Count > 0)
			{
				List<Maid> list;
				if (EmpireLifeModeManager.TryGetMaidListOfEventData(data2, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
				{
					Facility facility = correctFacilityList[UnityEngine.Random.Range(0, correctFacilityList.Count)];
					this.CreateAndCacheEvent(data2, facility, list);
					if (!this.nowMaidAllocationDic.ContainsKey(facility))
					{
						this.nowMaidAllocationDic.Add(facility, new List<Maid>());
					}
					this.nowMaidAllocationDic[facility].AddRange(list);
					Debug.Log("イベントの作成に成功");
					return;
				}
			}
		}
		Debug.Log("イベントの作成に失敗");
	}

	public void AllMaidRandomAllocate()
	{
		Dictionary<Facility, int> dictionary = new Dictionary<Facility, int>();
		foreach (Facility key in EmpireLifeModeAPI.GetEnabledFacilityList())
		{
			int num = 0;
			if (!this.nowMaidAllocationDic.ContainsKey(key))
			{
				this.nowMaidAllocationDic.Add(key, new List<Maid>());
			}
			else if (this.nowMaidAllocationDic[key] != null)
			{
				num = this.nowMaidAllocationDic[key].Count;
			}
			else
			{
				num = 0;
			}
			if (num < 3)
			{
				if (!dictionary.ContainsKey(key))
				{
					dictionary.Add(key, num);
				}
			}
		}
		List<Maid> notAllocatedMaidList = this.GetNotAllocatedMaidList(this.lifeModeAllMaidList);
		from maid in notAllocatedMaidList
		orderby UnityEngine.Random.Range(0, 100)
		select maid;
		foreach (Maid item in notAllocatedMaidList)
		{
			List<Facility> list = new List<Facility>(dictionary.Keys);
			List<int> list2 = new List<int>(dictionary.Values);
			int index = UnityEngine.Random.Range(0, dictionary.Count);
			this.nowMaidAllocationDic[list[index]].Add(item);
			Dictionary<Facility, int> dictionary2;
			Facility key2;
			if (((dictionary2 = dictionary)[key2 = list[index]] = dictionary2[key2] + 1) >= 3)
			{
				dictionary.Remove(list[index]);
				if (dictionary.Count <= 0)
				{
					break;
				}
			}
		}
	}

	public void CreateEventListOfMaidAllocateData()
	{
		foreach (KeyValuePair<Facility, List<Maid>> keyValuePair in this.nowMaidAllocationDic)
		{
			Facility facility = keyValuePair.Key;
			List<Maid> list = new List<Maid>(keyValuePair.Value);
			foreach (EmpireLifeModeManager.EventDataObject eventDataObject in from d in this.nowEventList
			where d.targetFacility == facility
			select d)
			{
				foreach (Maid item in eventDataObject.targetMaidList)
				{
					list.Remove(item);
				}
			}
			List<EmpireLifeModeData.Data> datas = EmpireLifeModeData.GetDatas((EmpireLifeModeData.Data data) => data.IsCorrectUniqueComparisonObject() && data.dataScenarioType != EmpireLifeModeData.ScenarioType.スト\u30FCリ\u30FC && data.IsCorrectFacility(facility.defaultName) && data.IsCorrectScenarioAnyNumberPlay(), true);
			IOrderedEnumerable<EmpireLifeModeData.Data> source = from d in datas
			orderby d.dataMaidPersonalUniqueNameAndActiveSlotDic.Count descending
			select d;
			if (EmpireLifeModeManager.<>f__mg$cache0 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache0 = new Func<EmpireLifeModeData.Data, int>(EmpireLifeModeAPI.GetPriorityScenarioType);
			}
			IOrderedEnumerable<EmpireLifeModeData.Data> orderedEnumerable = source.ThenByDescending(EmpireLifeModeManager.<>f__mg$cache0);
			Dictionary<int, int> eventSelectCountDic = new Dictionary<int, int>();
			foreach (EmpireLifeModeData.Data data3 in orderedEnumerable)
			{
				eventSelectCountDic.Add(data3.ID, 0);
			}
			while (list.Count > 0)
			{
				bool flag = false;
				foreach (EmpireLifeModeData.Data data2 in orderedEnumerable.ThenBy((EmpireLifeModeData.Data d) => eventSelectCountDic[d.ID]).ThenBy((EmpireLifeModeData.Data d) => UnityEngine.Random.Range(0, 10)))
				{
					List<Maid> list2;
					if (EmpireLifeModeManager.TryGetMaidListOfEventData(data2, list, out list2))
					{
						this.CreateAndCacheEvent(data2, facility, list2);
						Dictionary<int, int> eventSelectCountDic2;
						int id;
						(eventSelectCountDic2 = eventSelectCountDic)[id = data2.ID] = eventSelectCountDic2[id] + 1;
						flag = true;
						foreach (Maid item2 in list2)
						{
							list.Remove(item2);
						}
						if (list.Count == 0)
						{
							break;
						}
					}
				}
				if (!flag)
				{
					break;
				}
			}
		}
	}

	public void DeleteNowEventList()
	{
		this.nowEventList.Clear();
		this.nowMaidAllocationDic.Clear();
	}

	public void OnTimeZoneChanged()
	{
		this.nowEventList.Clear();
		this.nowMaidAllocationDic.Clear();
		this.executedEventList.Clear();
		this.executedMaidList.Clear();
		this.UpdateAllMaidList();
		EmpireLifeModeAPI.DestroyScenarioTypeIconDic();
	}

	public void OnNextDay()
	{
		this.nowEventList.Clear();
		this.nowMaidAllocationDic.Clear();
		this.executedEventList.Clear();
		this.executedMaidList.Clear();
	}

	public void SetupScenarioEvent(EmpireLifeModeManager.EventDataObject eventObj, Action OnComplete)
	{
		base.StartCoroutine(this.CoSetupScenarioEvent(eventObj, OnComplete));
		GameMain.Instance.ScriptMgr.EvalScript("&tf['scenario_file_name'] = '" + eventObj.targetEvent.dataScenarioFileName + "';");
		GameMain.Instance.ScriptMgr.EvalScript("&tf['label_name'] = '" + eventObj.targetEvent.dataScenarioFileLabel + "';");
		this.nowEventList.Remove(eventObj);
		this.executedEventList.Add(eventObj);
		foreach (Maid maid in eventObj.targetMaidList)
		{
			this.IncrementMaidScenarioExecuteCount(eventObj.targetEvent.ID, maid);
		}
		foreach (Maid item in eventObj.targetMaidList)
		{
			this.executedMaidList.Add(item);
		}
	}

	private IEnumerator CoSetupScenarioEvent(EmpireLifeModeManager.EventDataObject eventObj, Action OnComplete)
	{
		EmpireLifeModeData.Data data = eventObj.targetEvent;
		List<Maid> targetMaidList = new List<Maid>(eventObj.targetMaidList);
		foreach (KeyValuePair<int, string> maidPersonalSlotPair in data.dataMaidPersonalUniqueNameAndActiveSlotDic)
		{
			int slotNo = maidPersonalSlotPair.Key;
			string personalUniqueName = maidPersonalSlotPair.Value;
			Maid maid = targetMaidList.Find((Maid m) => m.status.personal.uniqueName == personalUniqueName);
			targetMaidList.Remove(maid);
			GameMain.Instance.CharacterMgr.SetActiveMaid(maid, slotNo);
			maid.Visible = true;
			maid.AllProcPropSeqStart();
			while (maid.IsBusy)
			{
				yield return null;
			}
			if (data.dataFacilityCostumeChange)
			{
				if (eventObj.targetFacility.typeCostume == Facility.CostumeType.Default)
				{
					eventObj.targetFacility.UpdateMaidCostumeToDefaultCostume(maid);
				}
				else if (eventObj.targetFacility.typeCostume == Facility.CostumeType.Edit)
				{
					eventObj.targetFacility.UpdateMaidCostumeToEditCostume(maid, false);
				}
			}
			maid.AllProcPropSeqStart();
		}
		for (;;)
		{
			bool isAllMaidLoadComplete = true;
			foreach (Maid maid2 in eventObj.targetMaidList)
			{
				if (maid2.IsBusy)
				{
					isAllMaidLoadComplete = false;
					break;
				}
			}
			if (isAllMaidLoadComplete)
			{
				break;
			}
			yield return null;
		}
		if (OnComplete != null)
		{
			OnComplete();
		}
		yield break;
	}

	private static bool TryGetMaidListOfEventData(EmpireLifeModeData.Data data, IEnumerable<Maid> maidList, out List<Maid> resultList)
	{
		resultList = new List<Maid>();
		List<string> list = new List<string>(data.dataMaidPersonalUniqueNameAndActiveSlotDic.Values);
		List<Maid> list2 = new List<Maid>(maidList);
		if (list.Count > list2.Count)
		{
			return false;
		}
		foreach (string b in list)
		{
			Maid maid = null;
			foreach (Maid maid2 in list2)
			{
				if (maid2.status.personal.uniqueName == b && data.IsCorrectMaid(maid2))
				{
					maid = maid2;
					break;
				}
			}
			if (!(maid != null))
			{
				return false;
			}
			resultList.Add(maid);
			if (resultList.Count == list.Count)
			{
				return true;
			}
			list2.Remove(maid);
		}
		return false;
	}

	public List<Maid> GetNotAllocatedMaidList(List<Maid> maidList)
	{
		List<Maid> list = new List<Maid>();
		if (maidList == null || maidList.Count <= 0)
		{
			return list;
		}
		for (int i = maidList.Count - 1; i >= 0; i--)
		{
			if (!this.executedMaidList.Contains(maidList[i]))
			{
				if (!this.IsAllocatedMaid(maidList[i]))
				{
					list.Add(maidList[i]);
				}
			}
		}
		return list;
	}

	public bool IsAllocatedMaid(Maid maid)
	{
		NDebug.Assert(maid != null, "判定するキャラクターにnullが指定されました");
		foreach (EmpireLifeModeManager.EventDataObject eventDataObject in this.nowEventList)
		{
			if (eventDataObject.targetMaidList != null && eventDataObject.targetMaidList.Contains(maid))
			{
				return true;
			}
		}
		return false;
	}

	private DataArray<int, byte> CreateMaidDataArray(Maid maid)
	{
		NDebug.AssertNull(maid);
		string guid = maid.status.guid;
		if (this.m_SaveDataMaidScenarioExecuteCountArray.ContainsKey(guid))
		{
			return this.m_SaveDataMaidScenarioExecuteCountArray[guid];
		}
		DataArray<int, byte> dataArray = new DataArray<int, byte>();
		this.m_SaveDataMaidScenarioExecuteCountArray.Add(guid, dataArray);
		Debug.LogFormat("メイド「{0}」の情報を作成しました。", new object[]
		{
			maid.status.fullNameJpStyle
		});
		return dataArray;
	}

	public int GetMaidScenarioExecuteCount(int eventID, Maid maid)
	{
		NDebug.AssertNull(maid);
		string guid = maid.status.guid;
		if (!this.m_SaveDataMaidScenarioExecuteCountArray.ContainsKey(guid))
		{
			return 0;
		}
		return (int)this.m_SaveDataMaidScenarioExecuteCountArray[guid].Get(eventID, false);
	}

	private void IncrementMaidScenarioExecuteCount(int eventID, Maid maid)
	{
		NDebug.AssertNull(maid);
		string guid = maid.status.guid;
		DataArray<int, byte> dataArray = this.CreateMaidDataArray(maid);
		byte b = dataArray.Get(eventID, false);
		if (b < 255)
		{
			b += 1;
		}
		dataArray.Add(eventID, b, true);
		this.m_SaveDataScenarioExecuteCountArray.Add(eventID, b, true);
	}

	public int GetScenarioExecuteCount(int eventID)
	{
		if (!this.m_SaveDataScenarioExecuteCountArray.Contains(eventID))
		{
			return 0;
		}
		return (int)this.m_SaveDataScenarioExecuteCountArray.Get(eventID, false);
	}

	public bool Serialize(BinaryWriter brWrite)
	{
		brWrite.Write("CM3D21_LIFE_MODE_MGR");
		brWrite.Write(1250);
		brWrite.Write("2");
		DataArray<int, byte> saveDataScenarioExecuteCountArray = this.m_SaveDataScenarioExecuteCountArray;
		if (EmpireLifeModeManager.<>f__mg$cache1 == null)
		{
			EmpireLifeModeManager.<>f__mg$cache1 = new Converter<int, byte[]>(Util.GetBytes);
		}
		saveDataScenarioExecuteCountArray.Serialize(brWrite, EmpireLifeModeManager.<>f__mg$cache1, (byte data) => new byte[]
		{
			data
		});
		int count = this.m_SaveDataMaidScenarioExecuteCountArray.Count;
		brWrite.Write(count);
		foreach (KeyValuePair<string, DataArray<int, byte>> keyValuePair in this.m_SaveDataMaidScenarioExecuteCountArray)
		{
			brWrite.Write(keyValuePair.Key);
			DataArray<int, byte> value = keyValuePair.Value;
			if (EmpireLifeModeManager.<>f__mg$cache2 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache2 = new Converter<int, byte[]>(Util.GetBytes);
			}
			value.Serialize(brWrite, EmpireLifeModeManager.<>f__mg$cache2, (byte data) => new byte[]
			{
				data
			});
		}
		List<string> list = new List<string>();
		foreach (Maid maid in this.lifeModeAllMaidList)
		{
			if (maid != null)
			{
				list.Add(maid.status.guid);
			}
		}
		brWrite.Write(list.Count);
		foreach (string value2 in list)
		{
			brWrite.Write(value2);
		}
		return true;
	}

	public bool Deserialize(BinaryReader brRead)
	{
		this.m_SaveDataScenarioExecuteCountArray.Clear();
		this.m_SaveDataMaidScenarioExecuteCountArray.Clear();
		if (brRead.BaseStream.Length <= brRead.BaseStream.Position + 1L)
		{
			Debug.Log("LifeMode\nこれ以上は読めない");
			return false;
		}
		long position = brRead.BaseStream.Position;
		string text = brRead.ReadString();
		if (text != "CM3D21_LIFE_MODE_MGR")
		{
			Debug.Log("LifeMode\nヘッダー取得に失敗しました。\n" + text);
			brRead.BaseStream.Seek(position, SeekOrigin.Begin);
			return false;
		}
		int num = brRead.ReadInt32();
		position = brRead.BaseStream.Position;
		string text2 = brRead.ReadString();
		int num2;
		if (string.IsNullOrEmpty(text2))
		{
			num2 = 0;
			brRead.BaseStream.Seek(position, SeekOrigin.Begin);
		}
		else
		{
			int num3 = 0;
			if (int.TryParse(text2, out num3) && num3 > 0 && 100 > num3)
			{
				num2 = num3;
			}
			else
			{
				num2 = 0;
				brRead.BaseStream.Seek(position, SeekOrigin.Begin);
			}
		}
		if (num2 <= 1)
		{
			if (EmpireLifeModeManager.<>f__mg$cache3 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache3 = new Func<BinaryReader, int>(Util.ToInt32);
			}
			Func<BinaryReader, int> func_read_key = EmpireLifeModeManager.<>f__mg$cache3;
			if (EmpireLifeModeManager.<>f__mg$cache4 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache4 = new Func<BinaryReader, int>(Util.ToInt32);
			}
			DataArray<int, int>.Skip(brRead, func_read_key, EmpireLifeModeManager.<>f__mg$cache4);
		}
		else
		{
			DataArray<int, byte> saveDataScenarioExecuteCountArray = this.m_SaveDataScenarioExecuteCountArray;
			if (EmpireLifeModeManager.<>f__mg$cache5 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache5 = new Func<BinaryReader, int>(Util.ToInt32);
			}
			Func<BinaryReader, int> func_read_key2 = EmpireLifeModeManager.<>f__mg$cache5;
			if (EmpireLifeModeManager.<>f__mg$cache6 == null)
			{
				EmpireLifeModeManager.<>f__mg$cache6 = new Func<BinaryReader, byte>(Util.ToByte);
			}
			saveDataScenarioExecuteCountArray.Deserialize(brRead, func_read_key2, EmpireLifeModeManager.<>f__mg$cache6);
			int num4 = brRead.ReadInt32();
			for (int i = 0; i < num4; i++)
			{
				string text3 = brRead.ReadString();
				Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(text3);
				if (stockMaid == null)
				{
					Debug.LogFormat("■GUID「{0}」のメイドは存在しなかったので、このメイドの情報は読み飛ばします", new object[]
					{
						text3
					});
					if (EmpireLifeModeManager.<>f__mg$cache7 == null)
					{
						EmpireLifeModeManager.<>f__mg$cache7 = new Func<BinaryReader, int>(Util.ToInt32);
					}
					Func<BinaryReader, int> func_read_key3 = EmpireLifeModeManager.<>f__mg$cache7;
					if (EmpireLifeModeManager.<>f__mg$cache8 == null)
					{
						EmpireLifeModeManager.<>f__mg$cache8 = new Func<BinaryReader, byte>(Util.ToByte);
					}
					DataArray<int, byte>.Skip(brRead, func_read_key3, EmpireLifeModeManager.<>f__mg$cache8);
				}
				else
				{
					DataArray<int, byte> dataArray = this.CreateMaidDataArray(stockMaid);
					DataArray<int, byte> dataArray2 = dataArray;
					if (EmpireLifeModeManager.<>f__mg$cache9 == null)
					{
						EmpireLifeModeManager.<>f__mg$cache9 = new Func<BinaryReader, int>(Util.ToInt32);
					}
					Func<BinaryReader, int> func_read_key4 = EmpireLifeModeManager.<>f__mg$cache9;
					if (EmpireLifeModeManager.<>f__mg$cacheA == null)
					{
						EmpireLifeModeManager.<>f__mg$cacheA = new Func<BinaryReader, byte>(Util.ToByte);
					}
					dataArray2.Deserialize(brRead, func_read_key4, EmpireLifeModeManager.<>f__mg$cacheA);
				}
			}
			List<Maid> list = new List<Maid>();
			num4 = brRead.ReadInt32();
			for (int j = 0; j < num4; j++)
			{
				string guid = brRead.ReadString();
				Maid stockMaid2 = GameMain.Instance.CharacterMgr.GetStockMaid(guid);
				if (stockMaid2 != null)
				{
					list.Add(stockMaid2);
				}
			}
			this.SetAllMaidList(list);
		}
		return true;
	}

	private const int MAX_COUNT_MAID_ALLOCATE = 3;

	private List<EmpireLifeModeManager.EventDataObject> m_EventList = new List<EmpireLifeModeManager.EventDataObject>();

	private Dictionary<Facility, List<Maid>> m_NowMaidAllocationDic = new Dictionary<Facility, List<Maid>>();

	private List<EmpireLifeModeManager.EventDataObject> m_ExecutedEventList = new List<EmpireLifeModeManager.EventDataObject>();

	private List<Maid> m_LifeModeAllMaidList = new List<Maid>();

	private List<Maid> m_ExecutedMaidList = new List<Maid>();

	private Dictionary<string, DataArray<int, byte>> m_SaveDataMaidScenarioExecuteCountArray = new Dictionary<string, DataArray<int, byte>>();

	private DataArray<int, byte> m_SaveDataScenarioExecuteCountArray = new DataArray<int, byte>();

	private const string STR_LOG_HEAD = "LifeMode\n";

	private const string STR_LIFE_MODE_SERIALIZE_HEADER = "CM3D21_LIFE_MODE_MGR";

	private const string STR_LIFE_MODE_SERIALIZE_VER = "2";

	[CompilerGenerated]
	private static Func<EmpireLifeModeData.Data, int> <>f__mg$cache0;

	[CompilerGenerated]
	private static Converter<int, byte[]> <>f__mg$cache1;

	[CompilerGenerated]
	private static Converter<int, byte[]> <>f__mg$cache2;

	[CompilerGenerated]
	private static Func<BinaryReader, int> <>f__mg$cache3;

	[CompilerGenerated]
	private static Func<BinaryReader, int> <>f__mg$cache4;

	[CompilerGenerated]
	private static Func<BinaryReader, int> <>f__mg$cache5;

	[CompilerGenerated]
	private static Func<BinaryReader, byte> <>f__mg$cache6;

	[CompilerGenerated]
	private static Func<BinaryReader, int> <>f__mg$cache7;

	[CompilerGenerated]
	private static Func<BinaryReader, byte> <>f__mg$cache8;

	[CompilerGenerated]
	private static Func<BinaryReader, int> <>f__mg$cache9;

	[CompilerGenerated]
	private static Func<BinaryReader, byte> <>f__mg$cacheA;

	public class EventDataObject
	{
		public Facility targetFacility { get; set; }

		public EmpireLifeModeData.Data targetEvent { get; set; }

		public List<Maid> targetMaidList;
	}
}
