void LoadAll() { for (int i = 0; i < Config.setNum; ++i) { string fileName = Config.prefix + i.ToString() + Config.postfix; List <float> runes = runeManager.GetRuneList(i); StreamReader sr = new StreamReader(fileName); string s; float v; while (!sr.EndOfStream) { s = sr.ReadLine(); if (Single.TryParse(s, out v)) { runes.Add(v); } } sr.Close(); } }
public void OnRuneSettingChanged() { if (runeManager.currentRuneId >= Config.setNum - 2) { return; } float t; if (!Single.TryParse(runeSizeInputField.text, out t)) { return; } runeSize = (int)(t * 1000 + 0.5f); if (!Single.TryParse(targetSizeInputField.text, out t)) { return; } targetSize = (int)(t * 1000 + 0.5f); if (runeSize <= 27000 || runeSize > 33000) { return; } if (targetSize <= 27000 || targetSize > 33000) { return; } if (runeSize > targetSize) { return; } if (runeSize <= 30000 && targetSize > 30000) { return; } float factor = 1f; if (runeSize > 30000) { factor = 0.5f; } food.Clear(); List <float> runes = runeManager.currentRuneList; for (int i = 0; i < runes.Count; ++i) { int value = (int)(((int)(runes[i] * 1000 + 0.5f) - 26500) * 0.2f * factor + 0.5f); food.Add(new CalUnit(runeManager.currentRuneId, i, value)); } runes = runeManager.GetRuneList(Config.setNum - 2); for (int i = 0; i < runes.Count; ++i) { int value = (int)(((int)(runes[i] * 1000 + 0.5f) - 26500) * 0.1f * factor + 0.5f); food.Add(new CalUnit(Config.setNum - 2, i, value)); } runes = runeManager.GetRuneList(Config.setNum - 1); for (int i = 0; i < runes.Count; ++i) { int value = (int)(((int)(runes[i] * 1000 + 0.5f) - 26500) * 0.2f * factor + 0.5f); food.Add(new CalUnit(Config.setNum - 1, i, value)); } Calculate(); }