123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- namespace Edit
- {
- public static class MaidProfile
- {
- public static string Create(Maid maid, bool employment)
- {
- Status status_ = maid.status;
- string profileText = string.Empty;
- Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back = delegate(MaidProfile.CsvDataBlock block, int x, int y)
- {
- profileText += block.csv.GetCellAsString(block.GetOriginalX(block.max_x - 1), block.GetOriginalY(y));
- return true;
- };
- string text = "profile_comment_1.nei";
- profileText = string.Empty;
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase.IsValid(), "file open failed.\n" + text);
- using (CsvParser csvParser = new CsvParser())
- {
- if (!csvParser.Open(afileBase))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- MaidProfile.CsvDataBlock csvDataBlock = new MaidProfile.CsvDataBlock(csvParser, 0);
- Func<MaidProfile.CsvDataBlock, int, bool> line_func = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- return true;
- }
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- string cellAsString3 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
- return !status_.partsDic.ContainsKey(cellAsString2) || status_.partsDic[cellAsString2] == cellAsString3;
- };
- csvDataBlock.BlockAnalysis(1, line_func, success_call_back);
- csvDataBlock.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func2 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- return true;
- }
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- return status_.features.ContainsKey(Feature.GetData(cellAsString2).id);
- };
- csvDataBlock.BlockAnalysis(1, line_func2, success_call_back);
- csvDataBlock.NextBlock();
- csvDataBlock.BlockAnalysis(1, line_func, success_call_back);
- }
- }
- text = "profile_comment_2.nei";
- using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase2.IsValid(), "file open failed.\n" + text);
- using (CsvParser csv = new CsvParser())
- {
- if (!csv.Open(afileBase2))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- MaidProfile.CsvDataBlock csvDataBlock2 = new MaidProfile.CsvDataBlock(csv, 0);
- string cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
- profileText += cellAsString.Replace("[n]", string.Empty + status_.body.bust);
- csvDataBlock2.NextBlock();
- cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
- profileText += cellAsString.Replace("[n]", string.Empty + status_.body.waist);
- csvDataBlock2.NextBlock();
- cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
- profileText += cellAsString.Replace("[n]", string.Empty + status_.body.hip);
- csvDataBlock2.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func3 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- string cellAsString2 = csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- if (cellAsString2.IndexOf(status_.body.cup) == -1)
- {
- return false;
- }
- bool flag = csv.GetCellAsString(cur_block.GetOriginalX(2), line_y) == "○";
- return !flag || (maid.Parts != null && 50 <= maid.GetProp(MPN.MuneTare).value);
- };
- csvDataBlock2.BlockAnalysis(1, line_func3, success_call_back);
- csvDataBlock2.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func4 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- if (cellAsInteger <= status_.body.waist)
- {
- return false;
- }
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
- {
- num = csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- int num2 = int.MaxValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(3), line_y))
- {
- num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(3), line_y);
- }
- return num <= status_.body.hip && status_.body.hip <= num2;
- };
- csvDataBlock2.BlockAnalysis(1, line_func4, success_call_back);
- csvDataBlock2.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func5 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int cellAsInteger = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- if (status_.personal.id != Personal.GetData(cellAsInteger).id)
- {
- return false;
- }
- if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
- {
- return true;
- }
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
- return status_.features.ContainsKey(Feature.GetData(cellAsString2).id);
- };
- csvDataBlock2.BlockAnalysis(1, line_func5, success_call_back);
- csvDataBlock2.NextBlock();
- csvDataBlock2.BlockAnalysis(1, line_func5, success_call_back);
- }
- }
- text = "profile_comment_3.nei";
- using (AFileBase afileBase3 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase3.IsValid(), "file open failed.\n" + text);
- using (CsvParser csv = new CsvParser())
- {
- if (!csv.Open(afileBase3))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- MaidProfile.CsvDataBlock csvDataBlock3 = new MaidProfile.CsvDataBlock(csv, 0);
- Func<MaidProfile.CsvDataBlock, int, bool> line_func6 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- num = csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- }
- int num2 = int.MaxValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
- {
- num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- if (num > status_.body.bust || status_.body.bust > num2)
- {
- return false;
- }
- num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(3), line_y))
- {
- num = csv.GetCellAsInteger(cur_block.GetOriginalX(3), line_y);
- }
- num2 = int.MaxValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(4), line_y))
- {
- num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(4), line_y);
- }
- if (num > status_.body.waist || status_.body.waist > num2)
- {
- return false;
- }
- num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(5), line_y))
- {
- num = csv.GetCellAsInteger(cur_block.GetOriginalX(5), line_y);
- }
- num2 = int.MaxValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(6), line_y))
- {
- num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(6), line_y);
- }
- return num <= status_.body.hip && status_.body.hip <= num2;
- };
- csvDataBlock3.BlockAnalysis(1, line_func6, success_call_back);
- csvDataBlock3.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func7 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int cellAsInteger = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- return status_.personal.id == Personal.GetData(cellAsInteger).id;
- };
- csvDataBlock3.BlockAnalysis(1, line_func7, success_call_back);
- csvDataBlock3.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func8 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- JobClass.Data data = JobClass.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y));
- return data.id == status_.selectedJobClass.data.id;
- };
- csvDataBlock3.BlockAnalysis(1, line_func8, success_call_back);
- }
- }
- text = "profile_comment_4.nei";
- using (AFileBase afileBase4 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase4.IsValid(), "file open failed.\n" + text);
- using (CsvParser csv = new CsvParser())
- {
- if (!csv.Open(afileBase4))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- Func<MaidProfile.CsvDataBlock, int, bool> line_func9 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = 1;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
- {
- YotogiClass.Data data = YotogiClass.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y));
- if (data.id != status_.selectedJobClass.data.id)
- {
- return false;
- }
- }
- int[] array = new int[]
- {
- status_.sexPlayNumberOfPeople,
- status_.inyoku,
- status_.lovely,
- status_.mvalue,
- status_.elegance,
- status_.hentai,
- status_.charm,
- status_.housi
- };
- foreach (int num2 in array)
- {
- if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
- {
- int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
- if (cellAsInteger > num2)
- {
- return false;
- }
- }
- }
- return true;
- };
- MaidProfile.CsvDataBlock csvDataBlock4 = new MaidProfile.CsvDataBlock(csv, 0);
- Func<MaidProfile.CsvDataBlock, int, bool> line_func10 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- Personal.Data data = Personal.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y));
- return status_.personal.id == data.id;
- };
- csvDataBlock4.BlockAnalysis(1, line_func10, success_call_back);
- csvDataBlock4.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func11 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- Contract cellAsInteger = (Contract)cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- return status_.contract == cellAsInteger;
- };
- csvDataBlock4.BlockAnalysis(1, line_func11, success_call_back);
- csvDataBlock4.NextBlock();
- if (!employment && status_.seikeiken == Seikeiken.No_No)
- {
- Func<MaidProfile.CsvDataBlock, int, bool> line_func12 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- }
- bool flag = num <= status_.inyoku;
- if (flag)
- {
- status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- return flag;
- };
- csvDataBlock4.BlockAnalysis(1, line_func12, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (employment && status_.seikeiken == Seikeiken.No_No)
- {
- csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (!employment && status_.seikeiken == Seikeiken.Yes_No)
- {
- Func<MaidProfile.CsvDataBlock, int, bool> line_func13 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- }
- bool flag = num <= status_.sexPlayNumberOfPeople;
- if (flag)
- {
- status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- return flag;
- };
- csvDataBlock4.BlockAnalysis(1, line_func13, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (employment && status_.seikeiken == Seikeiken.Yes_No)
- {
- csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (!employment && status_.seikeiken == Seikeiken.No_Yes)
- {
- Func<MaidProfile.CsvDataBlock, int, bool> line_func14 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- }
- bool flag = num <= status_.sexPlayNumberOfPeople;
- if (flag)
- {
- status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- return flag;
- };
- csvDataBlock4.BlockAnalysis(1, line_func14, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (employment && status_.seikeiken == Seikeiken.No_Yes)
- {
- csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (!employment && status_.seikeiken == Seikeiken.Yes_Yes)
- {
- Func<MaidProfile.CsvDataBlock, int, bool> line_func15 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- int num = int.MinValue;
- if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
- }
- bool flag = num <= status_.sexPlayNumberOfPeople;
- if (flag)
- {
- status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
- }
- return flag;
- };
- csvDataBlock4.BlockAnalysis(1, line_func15, success_call_back);
- }
- csvDataBlock4.NextBlock();
- if (employment && status_.seikeiken == Seikeiken.Yes_Yes)
- {
- csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
- }
- }
- }
- text = "profile_comment_5.nei";
- using (AFileBase afileBase5 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase5.IsValid(), "file open failed.\n" + text);
- using (CsvParser csv = new CsvParser())
- {
- if (!csv.Open(afileBase5))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- int comment_no = 0;
- MaidProfile.CsvDataBlock csvDataBlock5 = new MaidProfile.CsvDataBlock(csv, 0);
- Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back2 = delegate(MaidProfile.CsvDataBlock succes_block, int x, int y)
- {
- profileText += succes_block.csv.GetCellAsString(succes_block.GetOriginalX(succes_block.max_x - 3 + comment_no), succes_block.GetOriginalY(y));
- return true;
- };
- Func<MaidProfile.CsvDataBlock, int, bool> line_func16 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- int id = Propensity.GetData(cellAsString2).id;
- if (!status_.propensitys.ContainsKey(id))
- {
- return false;
- }
- string cellAsString3 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
- if (cellAsString3 != null)
- {
- if (!(cellAsString3 == "処女"))
- {
- if (!(cellAsString3 == "前穴"))
- {
- if (!(cellAsString3 == "後穴"))
- {
- if (cellAsString3 == "両穴")
- {
- if (status_.seikeiken != Seikeiken.Yes_Yes)
- {
- return false;
- }
- }
- }
- else if (status_.seikeiken != Seikeiken.No_Yes)
- {
- return false;
- }
- }
- else if (status_.seikeiken != Seikeiken.Yes_No)
- {
- return false;
- }
- }
- else if (status_.seikeiken != Seikeiken.No_No)
- {
- return false;
- }
- }
- int[] array = new int[]
- {
- status_.inyoku,
- status_.mvalue,
- status_.hentai,
- status_.housi
- };
- int num = 3;
- foreach (int num2 in array)
- {
- if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
- {
- int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
- if (cellAsInteger > num2)
- {
- return false;
- }
- }
- }
- comment_no = 0;
- int cellAsInteger2 = csv.GetCellAsInteger(cur_block.GetOriginalX(num++), line_y);
- if (0 < cellAsInteger2)
- {
- if (cellAsInteger2 > status_.lovely && cellAsInteger2 > status_.elegance && cellAsInteger2 > status_.charm)
- {
- return false;
- }
- SortedList<int, string> sortedList = new SortedList<int, string>();
- sortedList.Add(status_.lovely, "可憐");
- if (!sortedList.ContainsKey(status_.elegance))
- {
- sortedList.Add(status_.elegance, "気品");
- }
- if (!sortedList.ContainsKey(status_.charm))
- {
- sortedList.Add(status_.charm, "魅惑");
- }
- int num3 = sortedList.Count - 1;
- int num4 = 0;
- foreach (KeyValuePair<int, string> keyValuePair in sortedList)
- {
- if (num3 == num4)
- {
- string value = keyValuePair.Value;
- if (value != null)
- {
- if (!(value == "気品"))
- {
- if (value == "魅惑")
- {
- comment_no = 2;
- }
- }
- else
- {
- comment_no = 1;
- }
- }
- break;
- }
- num4++;
- }
- }
- return true;
- };
- csvDataBlock5.BlockAnalysis(1, line_func16, success_call_back2);
- }
- }
- text = "profile_comment_6.nei";
- using (AFileBase afileBase6 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase6.IsValid(), "file open failed.\n" + text);
- using (CsvParser csvParser2 = new CsvParser())
- {
- if (!csvParser2.Open(afileBase6))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- MaidProfile.CsvDataBlock csvDataBlock6 = new MaidProfile.CsvDataBlock(csvParser2, 0);
- csvDataBlock6.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func17 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- return true;
- }
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- Feature.Data data = Feature.GetData(cellAsString2);
- return status_.features.ContainsKey(data.id);
- };
- csvDataBlock6.BlockAnalysis(1, line_func17, success_call_back);
- }
- }
- text = "profile_comment_7.nei";
- using (AFileBase afileBase7 = GameUty.FileSystem.FileOpen(text))
- {
- NDebug.Assert(afileBase7.IsValid(), "file open failed.\n" + text);
- using (CsvParser csvParser3 = new CsvParser())
- {
- if (!csvParser3.Open(afileBase7))
- {
- NDebug.Assert("csv open failed.\n" + text, false);
- }
- MaidProfile.CsvDataBlock csvDataBlock7 = new MaidProfile.CsvDataBlock(csvParser3, 0);
- csvDataBlock7.NextBlock();
- Func<MaidProfile.CsvDataBlock, int, bool> line_func18 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
- {
- if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
- {
- return true;
- }
- string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
- Feature.Data data = Feature.GetData(cellAsString2);
- return status_.features.ContainsKey(data.id);
- };
- csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
- csvDataBlock7.NextBlock();
- csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
- csvDataBlock7.NextBlock();
- csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
- }
- }
- return profileText;
- }
- public static int UpdateInitPlayNumber(Maid maid)
- {
- Status status = maid.status;
- int result = 0;
- if (status.initSeikeiken != Seikeiken.No_No)
- {
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("init_keiken_num_setting.nei"))
- {
- int size = afileBase.GetSize();
- NDebug.Assert(afileBase.IsValid(), "file open failed.\ninit_keiken_num_setting.nei");
- using (CsvParser csvParser = new CsvParser())
- {
- if (!csvParser.Open(afileBase))
- {
- NDebug.Assert("csv open failed.\ninit_keiken_num_setting.nei", false);
- }
- for (int i = 2; i < csvParser.max_cell_y; i++)
- {
- if (!csvParser.IsCellToExistData(0, i))
- {
- break;
- }
- int num = 0;
- string cellAsString = csvParser.GetCellAsString(num++, i);
- Seikeiken seikeiken = Seikeiken.Yes_No;
- if (cellAsString == "前穴")
- {
- seikeiken = Seikeiken.Yes_No;
- }
- else if (cellAsString == "後穴")
- {
- seikeiken = Seikeiken.No_Yes;
- }
- else if (cellAsString == "両穴")
- {
- seikeiken = Seikeiken.Yes_Yes;
- }
- if (seikeiken == status.initSeikeiken)
- {
- int cellAsInteger = csvParser.GetCellAsInteger(num++, i);
- int cellAsInteger2 = csvParser.GetCellAsInteger(num++, i);
- int cellAsInteger3 = csvParser.GetCellAsInteger(num++, i);
- if (cellAsInteger2 <= status.inyoku && cellAsInteger3 <= status.hentai)
- {
- result = cellAsInteger;
- break;
- }
- }
- }
- }
- }
- }
- return result;
- }
- private const string FileNameProfileComment = "profile_comment";
- private class DataBlock
- {
- public int GetOriginalX(int x)
- {
- return this.rect.left + x;
- }
- public int GetOriginalY(int y)
- {
- return this.rect.top + y;
- }
- public int max_x
- {
- get
- {
- return this.rect.right - this.rect.left + 1;
- }
- }
- public int max_y
- {
- get
- {
- return this.rect.bottom - this.rect.top + 1;
- }
- }
- public PlaneRect<int> rect;
- }
- private class CsvDataBlock : MaidProfile.DataBlock
- {
- public CsvDataBlock(CsvParser check_csv, int check_start_y)
- {
- this.csv_ = check_csv;
- this.NextBlock(check_start_y);
- }
- public bool NextBlock(int check_start_y)
- {
- this.rect.left = 0;
- this.rect.bottom = this.csv_.max_cell_y - 1;
- for (int i = check_start_y; i < this.csv_.max_cell_y; i++)
- {
- if (this.csv_.IsCellToExistData(0, i))
- {
- this.rect.top = i;
- int j;
- for (j = 0; j < this.csv_.max_cell_x; j++)
- {
- if (!this.csv_.IsCellToExistData(j, i))
- {
- break;
- }
- }
- j--;
- this.rect.right = j;
- break;
- }
- }
- if (this.rect.right <= 0)
- {
- this.rect.left = (this.rect.right = (this.rect.top = (this.rect.bottom = 0)));
- return false;
- }
- for (int k = this.rect.top; k < this.csv_.max_cell_y; k++)
- {
- bool flag = false;
- for (int l = 0; l <= this.rect.right; l++)
- {
- if (this.csv_.IsCellToExistData(l, k))
- {
- flag = true;
- break;
- }
- }
- if (!flag)
- {
- this.rect.bottom = k - 1;
- break;
- }
- }
- for (int m = this.rect.left; m < this.csv_.max_cell_x; m++)
- {
- for (int n = this.rect.top; n <= this.rect.bottom; n++)
- {
- if (this.csv_.IsCellToExistData(m, n) && this.rect.right < m - 1)
- {
- this.rect.right = m - 1;
- }
- }
- }
- return true;
- }
- public void BlockAnalysis(int start_y, Func<MaidProfile.CsvDataBlock, int, bool> line_func, Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back)
- {
- for (int i = start_y; i < base.max_y; i++)
- {
- if (line_func(this, base.GetOriginalY(i)) && success_call_back(this, this.rect.left, i))
- {
- return;
- }
- }
- }
- public bool NextBlock()
- {
- return this.NextBlock(base.GetOriginalY(base.max_y));
- }
- public CsvParser csv
- {
- get
- {
- return this.csv_;
- }
- }
- private CsvParser csv_;
- }
- }
- }
|