123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704 |
- 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(1350);
- 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;
- }
- }
|