public static void Load() { var f = File.OpenText(Environment.CurrentDirectory + "/resources/database/abnormalities.tsv"); Abnormalities = new Dictionary <uint, Abnormality>(); while (true) { var line = f.ReadLine(); if (line == null) { break; } var s = line.Split('\t'); var id = Convert.ToUInt32(s[0]); Enum.TryParse(s[1], out AbnormalityType t); var isShow = bool.Parse(s[2]); var isBuff = bool.Parse(s[3]); var infinity = bool.Parse(s[4]); var name = s[5]; var tooltip = s[6].Replace("
", "\n"); var iconName = s[7]; var ab = new Abnormality(id, isShow, isBuff, infinity, t); ab.SetIcon(iconName); ab.SetInfo(name, tooltip); Abnormalities.Add(id, ab); } }
public AbnormalityDuration(Abnormality b, uint d, int s, ulong t, Dispatcher disp, bool animated /*,double iconSize, double bgEllSize, Thickness margin*/) { _count++; _dispatcher = disp; Animated = animated; Abnormality = b; Duration = d; Stacks = s; Target = t; _isTimerDisposed = false; //IconSize = iconSize; //BackgroundEllipseSize = bgEllSize; //IndicatorMargin = margin; DurationLeft = d; if (!Abnormality.Infinity) { timer = new Timer(1000); timer.Elapsed += DecreaseDuration; timer.Disposed += SetDisposed; timer.Start(); } }