123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- namespace Kasizuki
- {
- public static class LikabilityReplace
- {
- public static string GetLikabilityName(int likability)
- {
- LikabilityReplace.CreateData();
- string text = string.Empty;
- foreach (KeyValuePair<int, string> keyValuePair in LikabilityReplace.basicData)
- {
- int key = keyValuePair.Key;
- if (likability < key)
- {
- break;
- }
- text = keyValuePair.Value;
- }
- if (string.IsNullOrEmpty(text))
- {
- NDebug.Assert("Error LikabilityRelation.GetRelationName(int)", false);
- }
- return text;
- }
- private static void CreateData()
- {
- if (LikabilityReplace.basicData != null)
- {
- return;
- }
- LikabilityReplace.basicData = new SortedDictionary<int, string>();
- string str = "kasizuki_likability_convert_list";
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(str + ".nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, str + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- int num = 0;
- int cellAsInteger = csvParser.GetCellAsInteger(num++, i);
- string cellAsString = csvParser.GetCellAsString(num++, i);
- LikabilityReplace.basicData.Add(cellAsInteger, cellAsString);
- }
- }
- }
- }
- private const string csvFileName = "kasizuki_likability_convert_list";
- private static SortedDictionary<int, string> basicData;
- }
- }
|