public static DoMultiple Instance(int doTimes, int cooldown, Behavior behavior) { var key = new Tuple<int, int, Behavior>(doTimes, cooldown, behavior); DoMultiple ret; if (!instances.TryGetValue(key, out ret)) ret = instances[key] = new DoMultiple(doTimes, cooldown, behavior); return ret; }
public static DoMultiple Instance(int doTimes, int cooldown, Behavior behavior) { var key = new Tuple <int, int, Behavior>(doTimes, cooldown, behavior); DoMultiple ret; if (!instances.TryGetValue(key, out ret)) { ret = instances[key] = new DoMultiple(doTimes, cooldown, behavior); } return(ret); }