/// <summary> /// Add a ticker which there can only exist one of. /// /// If the ticker exists, replaces it and returns false. /// Otherwise returns true. /// </summary> public bool AddUniqueTicker(TickerId id, ITicker ticker) { ITicker value = null; var added = true; if (uniqueTickers.TryGetValue(id, out value)) { value.Stop(); added = false; } uniqueTickers[id] = ticker; return(added); }
/// <summary> /// Add a thing that handles ticks every frame. /// </summary> public void AddTicker(ITicker ticker) { this.tickers.AddLast(ticker); }