123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using Schedule;
- using UnityEngine;
- using wf;
- public static class FacilityDataTable
- {
- public static void Init()
- {
- FacilityDataTable.m_FacilityMaterialCategoryNameArray = new Dictionary<int, string>();
- FacilityDataTable.ReadCSV("facility_material_category.nei", delegate(CsvParser csv)
- {
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- int num = 0;
- int cellAsInteger = csv.GetCellAsInteger(num++, i);
- string cellAsString = csv.GetCellAsString(num++, i);
- FacilityDataTable.m_FacilityMaterialCategoryNameArray.Add(cellAsInteger, cellAsString);
- }
- });
- FacilityDataTable.m_FacilityParameterNameArray = new Dictionary<int, string>();
- FacilityDataTable.ReadCSV("facility_parameters.nei", delegate(CsvParser csv)
- {
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- int num = 0;
- int cellAsInteger = csv.GetCellAsInteger(num++, i);
- string cellAsString = csv.GetCellAsString(num++, i);
- FacilityDataTable.m_FacilityParameterNameArray.Add(cellAsInteger, cellAsString);
- }
- });
- FacilityDataTable.m_FacilityCostumeEnableMPN = new List<MPN>();
- FacilityDataTable.ReadCSV("facility_costume_mpn_enable_list.nei", delegate(CsvParser csv)
- {
- List<MPN> list = new List<MPN>();
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- string cellAsString = csv.GetCellAsString(0, i);
- MPN item = MPN.null_mpn;
- try
- {
- item = (MPN)Enum.Parse(typeof(MPN), cellAsString);
- }
- catch (Exception e)
- {
- NDebug.AssertParseError("MPN", e);
- }
- FacilityDataTable.m_FacilityCostumeEnableMPN.Add(item);
- }
- });
- FacilityDataTable.m_FacilityDefaultCostumeArray = new Dictionary<int, Dictionary<MPN, KeyValuePair<bool, string>>>();
- FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray = new Dictionary<int, string>();
- FacilityDataTable.ReadCSV("facility_default_costume.nei", delegate(CsvParser csv)
- {
- int i = 1;
- int j = 4;
- while (i < csv.max_cell_x)
- {
- Dictionary<MPN, KeyValuePair<bool, string>> dictionary = new Dictionary<MPN, KeyValuePair<bool, string>>();
- int cellAsInteger = csv.GetCellAsInteger(i, 3);
- for (j = 4; j < csv.max_cell_y; j++)
- {
- if (!csv.IsCellToExistData(0, j))
- {
- break;
- }
- string cellAsString = csv.GetCellAsString(0, j);
- string text = csv.GetCellAsString(i, j);
- MPN mpn = MPN.null_mpn;
- try
- {
- mpn = (MPN)Enum.Parse(typeof(MPN), cellAsString);
- }
- catch (Exception ex)
- {
- FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray.Add(cellAsInteger, text);
- break;
- }
- bool key = !string.IsNullOrEmpty(text);
- if (!string.IsNullOrEmpty(text) && text.ToLower() != "del")
- {
- text += ".menu";
- }
- else if (!CM3.dicDelItem.TryGetValue(mpn, out text))
- {
- Debug.LogWarningFormat("[FacilityDataTable]MPN[{0}]のDelPropの取得に失敗しました", new object[]
- {
- mpn
- });
- }
- dictionary.Add(mpn, new KeyValuePair<bool, string>(key, text));
- }
- FacilityDataTable.m_FacilityDefaultCostumeArray.Add(cellAsInteger, dictionary);
- i++;
- }
- });
- FacilityDataTable.m_FacilityBusinessTypeDataArray = new Dictionary<int, FacilityDataTable.BusinessTypeData>();
- FacilityDataTable.ReadCSVBusinessTypeData();
- FacilityDataTable.m_FacilityDefaultDataArray = new Dictionary<int, FacilityDataTable.FacilityDefaultData>();
- FacilityDataTable.m_FacilityRecipeDataArray = new Dictionary<int, FacilityDataTable.FacilityRecipeData>();
- FacilityDataTable.m_FacilityMaterialDataArray = new Dictionary<int, FacilityDataTable.FacilityMaterialData>();
- FacilityDataTable.ReadCSVFacilityDefaultData();
- FacilityDataTable.ReadCSVFacilityPowerUpData();
- FacilityDataTable.ReadCSVFacilityMaterialData();
- }
- private static CsvParser GetCSV(string name)
- {
- if (!GameUty.FileSystem.IsExistentFile(name))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]csv「{0}」が見つからない", name));
- return null;
- }
- AFileBase file = GameUty.FileSystem.FileOpen(name);
- CsvParser csvParser = new CsvParser();
- if (!csvParser.Open(file))
- {
- Debug.LogError(string.Format("[FacilityDataTable]csv「{0}」を開くのに失敗", name));
- }
- return csvParser;
- }
- private static void ReadCSV(string fileName, Action<CsvParser> callback)
- {
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(fileName))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, fileName + "\nopen failed.");
- callback(csvParser);
- }
- }
- }
- private static void ReadCSVFacilityDefaultData()
- {
- CsvParser csv = FacilityDataTable.GetCSV("facility_power_up.nei");
- Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>();
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- int cell_x = 0;
- int cellAsInteger = csv.GetCellAsInteger(cell_x++, i);
- string text = string.Empty;
- int[] array = null;
- if (csv.IsCellToExistData(cell_x, i))
- {
- text = csv.GetCellAsString(cell_x++, i);
- }
- if (!string.IsNullOrEmpty(text))
- {
- string[] array2 = text.Split(new char[]
- {
- ','
- });
- array = new int[array2.Length];
- for (int j = 0; j < array.Length; j++)
- {
- array[j] = int.Parse(array2[j]);
- }
- }
- dictionary.Add(cellAsInteger, array);
- }
- Dictionary<int, List<int>> dictionary2 = new Dictionary<int, List<int>>();
- CsvParser csv2 = FacilityDataTable.GetCSV("facility_level_table.nei");
- for (int k = 1; k < csv2.max_cell_y; k++)
- {
- int num = 0;
- if (!csv2.IsCellToExistData(0, k))
- {
- break;
- }
- int cellAsInteger2 = csv2.GetCellAsInteger(num++, k);
- num++;
- List<int> list = new List<int>();
- for (int l = 0; l < 5; l++)
- {
- if (csv2.IsCellToExistData(num, k))
- {
- list.Add(csv2.GetCellAsInteger(num, k));
- }
- else
- {
- list.Add(l * 100);
- }
- num++;
- }
- dictionary2.Add(cellAsInteger2, list);
- }
- HashSet<int> enableList = new HashSet<int>();
- string[] array3 = new string[]
- {
- "facility_enabled_list"
- };
- foreach (string fileName in array3)
- {
- CsvCommonIdManager.ReadEnabledIdList(GameUty.FileSystem, GameUty.PathList, fileName, ref enableList);
- }
- CsvParser csv3 = FacilityDataTable.GetCSV("facility.nei");
- for (int n = 1; n < csv3.max_cell_y; n++)
- {
- if (!csv3.IsCellToExistData(0, n))
- {
- break;
- }
- FacilityDataTable.FacilityDefaultData facilityDefaultData = new FacilityDataTable.FacilityDefaultData(csv3, dictionary, dictionary2, enableList, n);
- FacilityDataTable.m_FacilityDefaultDataArray.Add(facilityDefaultData.ID, facilityDefaultData);
- }
- }
- private static void ReadCSVFacilityPowerUpData()
- {
- CsvParser csv = FacilityDataTable.GetCSV("facility_power_up_list.nei");
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- FacilityDataTable.FacilityRecipeData facilityRecipeData = new FacilityDataTable.FacilityRecipeData(csv, i);
- FacilityDataTable.m_FacilityRecipeDataArray.Add(facilityRecipeData.ID, facilityRecipeData);
- }
- }
- private static void ReadCSVFacilityMaterialData()
- {
- CsvParser csv = FacilityDataTable.GetCSV("facility_material.nei");
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- FacilityDataTable.FacilityMaterialData facilityMaterialData = new FacilityDataTable.FacilityMaterialData(csv, i);
- FacilityDataTable.m_FacilityMaterialDataArray.Add(facilityMaterialData.ID, facilityMaterialData);
- }
- }
- private static void ReadCSVBusinessTypeData()
- {
- CsvParser csv = FacilityDataTable.GetCSV("facility_business_type.nei");
- for (int i = 1; i < csv.max_cell_y; i++)
- {
- if (!csv.IsCellToExistData(0, i))
- {
- break;
- }
- FacilityDataTable.BusinessTypeData businessTypeData = new FacilityDataTable.BusinessTypeData(csv, i);
- FacilityDataTable.m_FacilityBusinessTypeDataArray.Add(businessTypeData.ID, businessTypeData);
- }
- }
- public static FacilityDataTable.FacilityDefaultData GetFacilityDefaultData(int facilityTypeID, bool enableDataOnly = true)
- {
- if (FacilityDataTable.m_FacilityDefaultDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
- return null;
- }
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は存在しないデータです", facilityTypeID));
- return null;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は有効ではありません", facilityTypeID));
- return null;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
- }
- public static int GetFacilityTypeID(string facilityName)
- {
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(facilityName, true);
- if (facilityDefaultData != null)
- {
- return facilityDefaultData.ID;
- }
- return -1;
- }
- public static FacilityDataTable.FacilityDefaultData GetFacilityDefaultData(string facilityDefaultName, bool enableDataOnly = true)
- {
- if (FacilityDataTable.m_FacilityDefaultDataArray == null)
- {
- NDebug.Assert("[FacilityDataTable]施設の基本情報の配列が未初期化です", false);
- return null;
- }
- foreach (KeyValuePair<int, FacilityDataTable.FacilityDefaultData> keyValuePair in FacilityDataTable.m_FacilityDefaultDataArray)
- {
- if (!(keyValuePair.Value.name != facilityDefaultName))
- {
- if (enableDataOnly && !keyValuePair.Value.isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設名[{0}]は有効ではありません", facilityDefaultName));
- return null;
- }
- return keyValuePair.Value;
- }
- }
- Debug.LogWarning(string.Format("施設名[{0}]は存在しないデータです", facilityDefaultName));
- return null;
- }
- public static Dictionary<int, ScheduleCSVData.Work> GetAllWorkData(bool enableDataOnly = true)
- {
- if (FacilityDataTable.m_FacilityDefaultDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
- return null;
- }
- Dictionary<int, ScheduleCSVData.Work> dictionary = new Dictionary<int, ScheduleCSVData.Work>();
- List<FacilityDataTable.FacilityDefaultData> list = new List<FacilityDataTable.FacilityDefaultData>(FacilityDataTable.m_FacilityDefaultDataArray.Values);
- for (int i = 0; i < list.Count; i++)
- {
- if (!enableDataOnly || list[i].isEnableData)
- {
- if (list[i].workData != null)
- {
- if (list[i].workData.id > 0)
- {
- if (dictionary.ContainsKey(list[i].workData.id))
- {
- NDebug.Assert("[営業施設と強化素材.xlsx]施設のスケジュールID" + list[i].workData.id + "が重複しています", false);
- return null;
- }
- dictionary.Add(list[i].workData.id, list[i].workData);
- }
- }
- }
- }
- return dictionary;
- }
- public static FacilityDataTable.FacilityRecipeData GetFacilityRecipeData(int recipeID)
- {
- if (FacilityDataTable.m_FacilityRecipeDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設強化レシピの基本情報の配列が未初期化です");
- return null;
- }
- if (!FacilityDataTable.m_FacilityRecipeDataArray.ContainsKey(recipeID))
- {
- Debug.LogFormat("[FacilityDataTable]施設強化レシピID[{0}]は存在しないデータです", new object[]
- {
- recipeID
- });
- return null;
- }
- return FacilityDataTable.m_FacilityRecipeDataArray[recipeID];
- }
- public static Facility.FacilityStatus GetFacilityStatus(int facilityTypeID, bool enableDataOnly = true)
- {
- if (FacilityDataTable.m_FacilityDefaultDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
- return null;
- }
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は存在しないデータです", facilityTypeID));
- return null;
- }
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
- if (enableDataOnly && !facilityDefaultData.isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は有効ではありません", facilityTypeID));
- return null;
- }
- return new Facility.FacilityStatus
- {
- name = facilityDefaultData.name,
- termName = facilityDefaultData.termName,
- typeID = facilityDefaultData.ID,
- parameter = new Facility.FacilityParameter(facilityDefaultData.income, facilityDefaultData.valuation, facilityDefaultData.experienceValue)
- };
- }
- public static Facility.PowerUpRecipe GetFacilityPowerUpRecipe(int recipeID)
- {
- if (FacilityDataTable.m_FacilityRecipeDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]強化レシピ情報の配列が未初期化です");
- return null;
- }
- if (!FacilityDataTable.m_FacilityRecipeDataArray.ContainsKey(recipeID))
- {
- Debug.Log(string.Format("[FacilityDataTable]施設強化レシピID[{0}]は存在しないデータです", recipeID));
- return null;
- }
- FacilityDataTable.FacilityRecipeData facilityRecipeData = FacilityDataTable.m_FacilityRecipeDataArray[recipeID];
- return new Facility.PowerUpRecipe
- {
- id = facilityRecipeData.ID,
- materialCategoryIDArray = facilityRecipeData.materialIDArray,
- name = facilityRecipeData.name,
- parameter = new Facility.FacilityParameter(facilityRecipeData.income, facilityRecipeData.valuation, facilityRecipeData.experienceValue)
- };
- }
- public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(int materialID)
- {
- if (FacilityDataTable.m_FacilityMaterialDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
- return null;
- }
- if (!FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID))
- {
- Debug.Log(string.Format("[FacilityDataTable]強化素材ID[{0}]は存在しないデータです", materialID));
- return null;
- }
- FacilityDataTable.FacilityMaterialData facilityMaterialData = FacilityDataTable.m_FacilityMaterialDataArray[materialID];
- return new Facility.PowerUpMaterial
- {
- id = facilityMaterialData.ID,
- categoryID = facilityMaterialData.categoryID,
- name = facilityMaterialData.name,
- parameter = new Facility.FacilityParameter(facilityMaterialData.income, facilityMaterialData.valuation, facilityMaterialData.experienceValue)
- };
- }
- public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(string materialName)
- {
- if (FacilityDataTable.m_FacilityMaterialDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
- return null;
- }
- foreach (KeyValuePair<int, FacilityDataTable.FacilityMaterialData> keyValuePair in FacilityDataTable.m_FacilityMaterialDataArray)
- {
- if (!(keyValuePair.Value.name != materialName))
- {
- return FacilityDataTable.GetFacilityPowerUpMaterial(keyValuePair.Value.ID);
- }
- }
- NDebug.Warning(string.Format("強化素材「{0}」の情報は存在しません", materialName));
- return null;
- }
- public static int GetFacilityPowerUpMaterialID(string materialName)
- {
- Facility.PowerUpMaterial facilityPowerUpMaterial = FacilityDataTable.GetFacilityPowerUpMaterial(materialName);
- if (facilityPowerUpMaterial != null)
- {
- return facilityPowerUpMaterial.id;
- }
- return -1;
- }
- public static Facility.FacilityStatus[] GetFacilityStatusArray(bool enableDataOnly = true)
- {
- if (FacilityDataTable.m_FacilityDefaultDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
- return null;
- }
- List<Facility.FacilityStatus> list = new List<Facility.FacilityStatus>();
- List<FacilityDataTable.FacilityDefaultData> list2 = new List<FacilityDataTable.FacilityDefaultData>(FacilityDataTable.m_FacilityDefaultDataArray.Values);
- for (int i = 0; i < list2.Count; i++)
- {
- if (!enableDataOnly || list2[i].isEnableData)
- {
- list.Add(FacilityDataTable.GetFacilityStatus(list2[i].ID, true));
- }
- }
- return list.ToArray();
- }
- public static int[] GetFacilityPowerUpMaterialIDArray()
- {
- if (FacilityDataTable.m_FacilityMaterialDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設の強化素材情報の配列が未初期化です");
- return null;
- }
- List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialDataArray.Keys);
- return list.ToArray();
- }
- public static Facility.PowerUpRecipe[] GetFacilityPowerUpRecipeArray()
- {
- if (FacilityDataTable.m_FacilityRecipeDataArray == null)
- {
- Debug.LogError("[FacilityDataTable]施設強化レシピ情報の配列が未初期化です");
- return null;
- }
- List<Facility.PowerUpRecipe> list = new List<Facility.PowerUpRecipe>();
- List<FacilityDataTable.FacilityRecipeData> list2 = new List<FacilityDataTable.FacilityRecipeData>(FacilityDataTable.m_FacilityRecipeDataArray.Values);
- for (int i = 0; i < list2.Count; i++)
- {
- list.Add(FacilityDataTable.GetFacilityPowerUpRecipe(list2[i].ID));
- }
- return list.ToArray();
- }
- public static bool IsExistFacilityData(int facilityTypeID, bool enableDataOnly = true)
- {
- return FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID) && (!enableDataOnly || FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData);
- }
- public static bool IsExistPowerUpMaterial(int materialID)
- {
- return FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID);
- }
- public static Facility.PowerUpMaterial[] GetFacilityPowerUpMaterialArray(int materialCategoryID)
- {
- List<Facility.PowerUpMaterial> list = new List<Facility.PowerUpMaterial>();
- List<FacilityDataTable.FacilityMaterialData> list2 = new List<FacilityDataTable.FacilityMaterialData>(FacilityDataTable.m_FacilityMaterialDataArray.Values);
- for (int i = 0; i < list2.Count; i++)
- {
- if (list2[i].categoryID == materialCategoryID)
- {
- list.Add(FacilityDataTable.GetFacilityPowerUpMaterial(list2[i].ID));
- }
- }
- return list.ToArray();
- }
- public static int GetFacilityPowerUpMaterialCount()
- {
- return FacilityDataTable.m_FacilityMaterialDataArray.Count;
- }
- public static bool IsExistFacilityPowerUpRecipe(int facilityTypeID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
- return false;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
- return false;
- }
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
- return facilityDefaultData.powerUpRecipeIDArray != null;
- }
- public static int[] GetFacilityPowerUpRecipeIDArray(int facilityTypeID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
- return null;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
- return null;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].powerUpRecipeIDArray;
- }
- public static string GetFacilityPowerUpMaterialCategoryName(int categoryID)
- {
- if (!FacilityDataTable.m_FacilityMaterialCategoryNameArray.ContainsKey(categoryID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]素材カテゴリID「{0}」のデータは存在しない", categoryID));
- return null;
- }
- return FacilityDataTable.m_FacilityMaterialCategoryNameArray[categoryID];
- }
- public static int[] GetFacilityPowerUpMaterialCategoryIDArray()
- {
- List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialCategoryNameArray.Keys);
- return list.ToArray();
- }
- public static string GetFacilityParameterName(int parameterID)
- {
- if (!FacilityDataTable.m_FacilityParameterNameArray.ContainsKey(parameterID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設パラメータID「{0}」のデータは存在しない", parameterID));
- return null;
- }
- return FacilityDataTable.m_FacilityParameterNameArray[parameterID];
- }
- public static bool GetFacilityCanBeUsedBusiness(int facilityID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
- return false;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
- return false;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isBusiness;
- }
- public static bool GetFacilityCanBeDestroy(int facilityID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
- return false;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
- return false;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isRemoval;
- }
- public static bool GetFacilityDefaultPlacement(int facilityID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
- return false;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
- return false;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isDefaultPlace;
- }
- public static int GetFacilityDefaultCost(int facilityID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
- return 0;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
- return 0;
- }
- return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].cost;
- }
- public static Sprite GetFacilityThumbnail(int facilityTypeID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
- {
- Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
- return null;
- }
- if (FacilityDataTable.m_FacilityThumbnailCacheDic == null)
- {
- FacilityDataTable.m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
- }
- Sprite sprite;
- if (FacilityDataTable.m_FacilityThumbnailCacheDic.TryGetValue(facilityTypeID, out sprite))
- {
- return sprite;
- }
- FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
- if (enableDataOnly && !facilityDefaultData.isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
- return null;
- }
- string text = facilityDefaultData.imageThumbnailName + ".tex";
- if (string.IsNullOrEmpty(text))
- {
- Debug.Log(string.Format("施設の種類ID[{0}]にはサムネイル画像情報がありません", facilityTypeID));
- return null;
- }
- if (!GameUty.FileSystem.IsExistentFile(text))
- {
- Debug.Log(string.Format("施設『{0}』のサムネイル画像「{1}」が見つかりませんでした", facilityDefaultData.name, text));
- return null;
- }
- Texture2D tex = ImportCM.CreateTexture(text);
- sprite = uGUIUtility.CreateSprite(tex);
- FacilityDataTable.m_FacilityThumbnailCacheDic.Add(facilityTypeID, sprite);
- return sprite;
- }
- public static Dictionary<MPN, KeyValuePair<bool, string>> GetFacilityDefaultCostume(int facilityTypeID, bool enableDataOnly = true, bool newBody = false)
- {
- if (!FacilityDataTable.m_FacilityDefaultCostumeArray.ContainsKey(facilityTypeID))
- {
- return null;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
- return null;
- }
- Dictionary<MPN, KeyValuePair<bool, string>> dictionary = FacilityDataTable.m_FacilityDefaultCostumeArray[facilityTypeID];
- MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
- if (newBody)
- {
- if (!dictionary.ContainsKey(MPN.acchead) || dictionary[MPN.acchead].Value.Contains("_del"))
- {
- dictionary[MPN.acchead] = new KeyValuePair<bool, string>(true, CM3.dicDelItem[MPN.acchead]);
- if (Array.FindIndex<MPN>(facilityCostumeEnableMPN, (MPN m) => m == MPN.acchead) == -1)
- {
- Array.Resize<MPN>(ref facilityCostumeEnableMPN, facilityCostumeEnableMPN.Length + 1);
- facilityCostumeEnableMPN[facilityCostumeEnableMPN.Length - 1] = MPN.acchead;
- }
- }
- if (!dictionary.ContainsKey(MPN.acckubi) || dictionary[MPN.acckubi].Value.Contains("_del"))
- {
- dictionary[MPN.acckubi] = new KeyValuePair<bool, string>(true, CM3.dicDelItem[MPN.acckubi]);
- if (Array.FindIndex<MPN>(facilityCostumeEnableMPN, (MPN m) => m == MPN.acckubi) == -1)
- {
- Array.Resize<MPN>(ref facilityCostumeEnableMPN, facilityCostumeEnableMPN.Length + 1);
- facilityCostumeEnableMPN[facilityCostumeEnableMPN.Length - 1] = MPN.acckubi;
- }
- }
- }
- Dictionary<MPN, KeyValuePair<bool, string>> dictionary2 = new Dictionary<MPN, KeyValuePair<bool, string>>();
- foreach (MPN key in facilityCostumeEnableMPN)
- {
- if (dictionary.ContainsKey(key))
- {
- dictionary2.Add(key, dictionary[key]);
- }
- }
- return dictionary2;
- }
- public static string GetFacilityDefaultCostumeThumbnailName(int facilityTypeID, bool enableDataOnly = true)
- {
- if (!FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray.ContainsKey(facilityTypeID))
- {
- return null;
- }
- if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
- {
- Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
- return null;
- }
- return FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray[facilityTypeID];
- }
- public static MPN[] GetFacilityCostumeEnableMPN()
- {
- return FacilityDataTable.m_FacilityCostumeEnableMPN.ToArray();
- }
- public static bool IsEnableFacilityCostumeMPN(MPN mpn)
- {
- return FacilityDataTable.m_FacilityCostumeEnableMPN.Contains(mpn);
- }
- public static int[] GetFacilityBusinessTypeIDArray(bool isExclusionEmptyData = true)
- {
- List<int> list = null;
- if (isExclusionEmptyData)
- {
- list = new List<int>();
- foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
- {
- if (keyValuePair.Key != 9999)
- {
- list.Add(keyValuePair.Key);
- }
- }
- }
- else
- {
- list = new List<int>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Keys);
- }
- return list.ToArray();
- }
- public static FacilityDataTable.BusinessTypeData[] GetFacilityBusinessTypeDataArray(bool isExclusionEmptyData = true)
- {
- List<FacilityDataTable.BusinessTypeData> list = null;
- if (isExclusionEmptyData)
- {
- list = new List<FacilityDataTable.BusinessTypeData>();
- foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
- {
- if (keyValuePair.Key != 9999)
- {
- list.Add(keyValuePair.Value);
- }
- }
- }
- else
- {
- list = new List<FacilityDataTable.BusinessTypeData>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Values);
- }
- return list.ToArray();
- }
- public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(int businessTypeID)
- {
- if (!FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID))
- {
- Debug.LogWarningFormat("[FacilityDataTable]事業の種類ID「{0}」に対応する情報がありません", new object[]
- {
- businessTypeID
- });
- return null;
- }
- return FacilityDataTable.m_FacilityBusinessTypeDataArray[businessTypeID];
- }
- public static bool IsExistFacilityBusinessTypeData(int businessTypeID)
- {
- return FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID);
- }
- public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(string businessName)
- {
- foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
- {
- if (!(keyValuePair.Value.name != businessName))
- {
- return keyValuePair.Value;
- }
- }
- Debug.LogWarningFormat("[FacilityDataTable]事業の名前「{0}」に対応する情報がありません", new object[]
- {
- businessName
- });
- return null;
- }
- private static Dictionary<int, FacilityDataTable.FacilityDefaultData> m_FacilityDefaultDataArray;
- private static Dictionary<int, FacilityDataTable.FacilityRecipeData> m_FacilityRecipeDataArray;
- private static Dictionary<int, FacilityDataTable.FacilityMaterialData> m_FacilityMaterialDataArray;
- private static Dictionary<int, FacilityDataTable.BusinessTypeData> m_FacilityBusinessTypeDataArray;
- private static Dictionary<int, string> m_FacilityMaterialCategoryNameArray;
- private static Dictionary<int, string> m_FacilityParameterNameArray;
- private static Dictionary<int, Dictionary<MPN, KeyValuePair<bool, string>>> m_FacilityDefaultCostumeArray;
- private static Dictionary<int, string> m_FacilityDefaultCostumeThumbnailArray;
- private static List<MPN> m_FacilityCostumeEnableMPN;
- private static Dictionary<int, Sprite> m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
- public enum BusinessType
- {
- 接待系 = 100,
- 営業系 = 200,
- アイドル系 = 300,
- 無し = 9999
- }
- public class FacilityDefaultData
- {
- public FacilityDefaultData(CsvParser csv, Dictionary<int, int[]> recipeIDArray, Dictionary<int, List<int>> levelTableList, HashSet<int> enableList, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- int cellAsInteger = csv.GetCellAsInteger(num++, y);
- this.name = csv.GetCellAsString(num++, y);
- csv.GetCellAsString(num++, y);
- this.businessTypeName = csv.GetCellAsString(num++, y);
- this.businessTypeID = FacilityDataTable.GetFacilityBusinessTypeData(this.businessTypeName).ID;
- this.upwardFacilityID = csv.GetCellAsInteger(num++, y);
- this.fileName = csv.GetCellAsString(num++, y);
- this.fileNameNight = csv.GetCellAsString(num++, y);
- this.rank = csv.GetCellAsInteger(num++, y);
- string cellAsString = csv.GetCellAsString(num++, y);
- this.cost = csv.GetCellAsInteger(num++, y);
- this.income = csv.GetCellAsInteger(num++, y);
- this.valuation = csv.GetCellAsInteger(num++, y);
- this.experienceValue = csv.GetCellAsInteger(num++, y);
- this.isBusiness = (csv.GetCellAsString(num++, y) == "〇");
- this.isDefaultPlace = (csv.GetCellAsString(num++, y) == "〇");
- this.isRemoval = (csv.GetCellAsString(num++, y) == "〇");
- string cellAsString2 = csv.GetCellAsString(num++, y);
- this.imageThumbnailName = csv.GetCellAsString(num++, y);
- string cellAsString3 = csv.GetCellAsString(num++, y);
- this.minMaidCount = csv.GetCellAsInteger(num++, y);
- this.maxMaidCount = csv.GetCellAsInteger(num++, y);
- this.heroineMagnification = csv.GetCellAsInteger(num++, y);
- string cellAsString4 = csv.GetCellAsString(num++, y);
- this.isEnableData = enableList.Contains(this.ID);
- if (string.IsNullOrEmpty(cellAsString2))
- {
- this.isEnableNTR = true;
- this.isOnlyNTR = false;
- }
- else if (cellAsString2 == "×")
- {
- this.isEnableNTR = false;
- this.isOnlyNTR = false;
- }
- else if (cellAsString2 == "〇" || cellAsString2 == "○")
- {
- this.isEnableNTR = true;
- this.isOnlyNTR = true;
- }
- if (recipeIDArray.ContainsKey(this.ID))
- {
- this.powerUpRecipeIDArray = recipeIDArray[this.ID];
- }
- else
- {
- this.powerUpRecipeIDArray = null;
- }
- string[] array = cellAsString.Split(new char[]
- {
- ','
- });
- this.staffRankArray = new int[4];
- for (int i = 0; i < this.staffRankArray.Length; i++)
- {
- try
- {
- int.TryParse(array[i], out this.staffRankArray[i]);
- }
- catch (Exception ex)
- {
- this.staffRankArray[i] = 0;
- }
- }
- if (levelTableList.ContainsKey(this.ID))
- {
- this.levelTable = levelTableList[this.ID];
- }
- else
- {
- this.levelTable = new List<int>();
- this.levelTable.Add(0);
- this.levelTable.Add(100);
- this.levelTable.Add(200);
- this.levelTable.Add(300);
- this.levelTable.Add(400);
- }
- try
- {
- this.businessType = (FacilityDataTable.BusinessType)Enum.Parse(typeof(FacilityDataTable.BusinessType), this.businessTypeName);
- }
- catch (Exception e)
- {
- NDebug.AssertParseError("BusinessType", e);
- }
- if (cellAsInteger < 0)
- {
- return;
- }
- this.workData = new ScheduleCSVData.Work();
- this.workData.type = ScheduleTaskCtrl.TaskType.Work;
- this.workData.id = cellAsInteger;
- this.workData.name = csv.GetCellAsString(num++, y);
- this.workData.icon = cellAsString3;
- string cellAsString5 = csv.GetCellAsString(num++, y);
- if (!string.IsNullOrEmpty(cellAsString5) && Enum.IsDefined(typeof(ScheduleCSVData.TrainingType), cellAsString5))
- {
- this.workData.trainingType = (ScheduleCSVData.TrainingType)Enum.Parse(typeof(ScheduleCSVData.TrainingType), cellAsString5, false);
- }
- this.workData.study_rate = csv.GetCellAsInteger(num++, y);
- this.workData.reception = csv.GetCellAsInteger(num++, y);
- this.workData.care = csv.GetCellAsInteger(num++, y);
- this.workData.lovely = csv.GetCellAsInteger(num++, y);
- this.workData.elegance = csv.GetCellAsInteger(num++, y);
- this.workData.charm = csv.GetCellAsInteger(num++, y);
- this.workData.teach_rate = csv.GetCellAsInteger(num++, y);
- this.workData.cooking = csv.GetCellAsInteger(num++, y);
- this.workData.vocal = csv.GetCellAsInteger(num++, y);
- this.workData.dance = csv.GetCellAsInteger(num++, y);
- this.workData.appealPoint = csv.GetCellAsInteger(num++, y);
- this.workData.exp = csv.GetCellAsInteger(num++, y);
- this.workData.income = csv.GetCellAsInteger(num++, y);
- this.workData.cmdExp = csv.GetCellAsInteger(num++, y);
- string cellAsString6 = csv.GetCellAsString(num++, y);
- this.workData.condContract = new List<Contract>();
- string[] array2 = cellAsString6.Split(new char[]
- {
- '|'
- }, StringSplitOptions.RemoveEmptyEntries);
- for (int j = 0; j < array2.Length; j++)
- {
- if (Enum.IsDefined(typeof(Contract), array2[j]))
- {
- this.workData.condContract.Add((Contract)Enum.Parse(typeof(Contract), array2[j], false));
- }
- }
- string cellAsString7 = csv.GetCellAsString(num++, y);
- this.workData.condMaidClass = new List<int>();
- string[] array3 = cellAsString7.Split(new char[]
- {
- '&'
- }, StringSplitOptions.RemoveEmptyEntries);
- for (int k = 0; k < array3.Length; k++)
- {
- int id = JobClass.GetData(array3[k]).id;
- this.workData.condMaidClass.Add(id);
- }
- this.workData.needEventItemIdList = new List<int>();
- if (csv.GetCellAsString(num, 0) == "必要状態")
- {
- this.workData.needMaidStatus = csv.GetCellAsString(num++, y);
- string cellAsString8 = csv.GetCellAsString(num++, y);
- if (!string.IsNullOrEmpty(cellAsString8))
- {
- string[] array4 = cellAsString8.Split(new char[]
- {
- '|'
- });
- foreach (string s in array4)
- {
- this.workData.needEventItemIdList.Add(int.Parse(s));
- }
- }
- }
- if (num < csv.max_cell_x)
- {
- string cellAsString9 = csv.GetCellAsString(num, y);
- if (cellAsString9 != null)
- {
- if (!(cellAsString9 == "表示"))
- {
- if (cellAsString9 == "非表示")
- {
- this.workData.disableIfRentalMaid = true;
- }
- }
- else
- {
- this.workData.visibleIfRentalMaid = true;
- }
- }
- }
- num++;
- if (num < csv.max_cell_x)
- {
- string cellAsString10 = csv.GetCellAsString(num, y);
- this.workData.isNewBodyBlock = (cellAsString10 == "〇" || cellAsString10 == "○");
- }
- num++;
- if (num < csv.max_cell_x)
- {
- this.workData.mainHeroineBodyTypeMatchCheckList = new HashSet<string>();
- string cellAsString11 = csv.GetCellAsString(num, y);
- foreach (string text in cellAsString11.Split(new char[]
- {
- ','
- }))
- {
- if (!string.IsNullOrEmpty(text))
- {
- string text2 = text.Trim();
- if (text2 != null)
- {
- if (text2 == "無垢" || text2 == "真面目" || text2 == "凜デレ")
- {
- this.workData.mainHeroineBodyTypeMatchCheckList.Add(text.Trim());
- goto IL_912;
- }
- }
- Debug.LogError(string.Concat(new object[]
- {
- "ID[",
- this.ID,
- "]",
- this.name,
- "のメインキャラとのボディ一致チェック項目で不正な文字列が指定されています=>",
- text.Trim()
- }));
- }
- IL_912:;
- }
- }
- num++;
- this.workData.condPackage = new List<string>();
- if (this.workData.id > 0)
- {
- this.workData.categoryID = 52;
- }
- this.workData.facility = this;
- }
- public bool isExistUpwardFacility
- {
- get
- {
- return FacilityDataTable.IsExistFacilityData(this.upwardFacilityID, true);
- }
- }
- public FacilityDataTable.FacilityDefaultData upwardFacility
- {
- get
- {
- if (!this.isExistUpwardFacility)
- {
- return null;
- }
- return FacilityDataTable.GetFacilityDefaultData(this.upwardFacilityID, true);
- }
- }
- public string termName
- {
- get
- {
- return "SceneFacilityManagement/施設名/" + this.name;
- }
- }
- public const string termRootText = "SceneFacilityManagement/";
- public readonly int ID;
- public readonly string name;
- public readonly string businessTypeName;
- public readonly int businessTypeID;
- public readonly FacilityDataTable.BusinessType businessType;
- public readonly string fileName;
- public readonly string fileNameNight;
- public readonly int cost;
- public readonly int income;
- public readonly int valuation;
- public readonly int experienceValue;
- public readonly bool isBusiness;
- public readonly bool isDefaultPlace;
- public readonly bool isRemoval;
- public readonly string imageThumbnailName;
- public readonly int[] powerUpRecipeIDArray;
- public readonly int minMaidCount;
- public readonly int maxMaidCount;
- public readonly int heroineMagnification;
- public readonly int rank;
- public readonly int[] staffRankArray;
- public readonly List<int> levelTable;
- public readonly ScheduleCSVData.Work workData;
- public readonly bool isEnableNTR;
- public readonly bool isOnlyNTR;
- public readonly bool isEnableData;
- private readonly int upwardFacilityID;
- }
- public class FacilityRecipeData
- {
- public FacilityRecipeData(CsvParser csv, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- this.name = csv.GetCellAsString(num++, y);
- string cellAsString = csv.GetCellAsString(num++, y);
- this.conditions = new string[FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM];
- for (int i = 0; i < FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM; i++)
- {
- this.conditions[i] = csv.GetCellAsString(num++, y);
- }
- this.salonGrade = csv.GetCellAsInteger(num++, y);
- string cellAsString2 = csv.GetCellAsString(num++, y);
- if (!string.IsNullOrEmpty(cellAsString2))
- {
- string[] array = cellAsString2.Split(new char[]
- {
- ','
- });
- ParametersPack.StatusType key = ParametersPack.NameToStatusType(array[0]);
- this.statusType = new KeyValuePair<ParametersPack.StatusType, int>(key, int.Parse(array[1]));
- }
- this.income = csv.GetCellAsInteger(num++, y);
- this.valuation = csv.GetCellAsInteger(num++, y);
- this.experienceValue = csv.GetCellAsInteger(num++, y);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- string[] array2 = cellAsString.Split(new char[]
- {
- ','
- });
- this.materialIDArray = new int[array2.Length];
- for (int j = 0; j < array2.Length; j++)
- {
- this.materialIDArray[j] = int.Parse(array2[j]);
- }
- }
- else
- {
- this.materialIDArray = null;
- }
- }
- public bool IsSatisfyTheConditions()
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- bool flag = true;
- flag &= (this.salonGrade <= GameMain.Instance.CharacterMgr.status.clubGrade);
- if (maid != null && this.statusType.Value > 0)
- {
- flag &= (this.statusType.Value <= FacilityDataTable.FacilityRecipeData.GetMaidStatusValue(maid, this.statusType.Key.ToString()));
- }
- else
- {
- Debug.LogWarning("メイド0番が見つかりません");
- }
- return flag;
- }
- private static int GetMaidStatusValue(Maid maid, string name)
- {
- switch (name)
- {
- case "接待":
- return maid.status.reception;
- case "お世話":
- return maid.status.care;
- case "可憐":
- return maid.status.lovely;
- case "気品":
- return maid.status.elegance;
- case "魅惑":
- return maid.status.charm;
- case "料理":
- return maid.status.cooking;
- case "ボーカル":
- return maid.status.vocal;
- case "ダンス":
- return maid.status.dance;
- case "アピールポイント":
- return maid.status.appealPoint;
- case "淫欲":
- return maid.status.inyoku;
- case "M性":
- return maid.status.mvalue;
- case "変態":
- return maid.status.hentai;
- case "奉仕":
- return maid.status.housi;
- case "指導":
- return maid.status.teachRate;
- case "経験人数":
- return maid.status.sexPlayNumberOfPeople;
- case "人気ランク":
- return maid.status.popularRank;
- case "評価":
- return maid.status.evaluation;
- }
- Debug.LogWarning("メイドパラメータ名" + name + "に対応する処理は未定義でした");
- return 9999;
- }
- public static readonly int CONDITIONS_NUM = 4;
- public readonly int ID;
- public readonly string name;
- public readonly int[] materialIDArray;
- public readonly int income;
- public readonly int valuation;
- public readonly int experienceValue;
- public readonly string[] conditions;
- public readonly int salonGrade;
- public readonly KeyValuePair<ParametersPack.StatusType, int> statusType;
- }
- public class FacilityMaterialData
- {
- public FacilityMaterialData(CsvParser csv, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- this.name = csv.GetCellAsString(num++, y);
- this.categoryID = csv.GetCellAsInteger(num++, y);
- this.income = csv.GetCellAsInteger(num++, y);
- this.valuation = csv.GetCellAsInteger(num++, y);
- this.experienceValue = csv.GetCellAsInteger(num++, y);
- }
- public readonly int ID;
- public readonly string name;
- public readonly int categoryID;
- public readonly int income;
- public readonly int valuation;
- public readonly int experienceValue;
- }
- public class BusinessTypeData
- {
- public BusinessTypeData(CsvParser csv, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- this.name = csv.GetCellAsString(num++, y);
- this.fileName = csv.GetCellAsString(num++, y);
- this.description = csv.GetCellAsString(num++, y);
- this.conditions = new string[FacilityDataTable.BusinessTypeData.CONDITIONS_NUM];
- for (int i = 0; i < FacilityDataTable.BusinessTypeData.CONDITIONS_NUM; i++)
- {
- this.conditions[i] = csv.GetCellAsString(num++, y);
- }
- }
- public static readonly int CONDITIONS_NUM = 2;
- public readonly int ID;
- public readonly string name;
- public readonly string fileName;
- public readonly string description;
- public readonly string[] conditions;
- }
- }
|