public ActiveSound FindActiveSound(SoundStyle style) { using (IEnumerator <SlotVector <ActiveSound> .ItemPair> enumerator = ((IEnumerable <SlotVector <ActiveSound> .ItemPair>) this._trackedSounds).GetEnumerator()) { while (((IEnumerator)enumerator).MoveNext()) { SlotVector <ActiveSound> .ItemPair current = enumerator.Current; if (((ActiveSound)current.Value).Style == style) { return((ActiveSound)current.Value); } } } return((ActiveSound)null); }
public void Update() { using (IEnumerator <SlotVector <ActiveSound> .ItemPair> enumerator = ((IEnumerable <SlotVector <ActiveSound> .ItemPair>) this._trackedSounds).GetEnumerator()) { while (((IEnumerator)enumerator).MoveNext()) { SlotVector <ActiveSound> .ItemPair current = enumerator.Current; ((ActiveSound)current.Value).Update(); if (!((ActiveSound)current.Value).IsPlaying) { this._trackedSounds.Remove((SlotId)current.Id); } } } }
public void Draw(ref MapOverlayDrawContext context, ref string text) { SpriteFrame frame = new SpriteFrame((byte)1, (byte)5); DateTime now = DateTime.Now; using (IEnumerator <SlotVector <PingMapLayer.Ping> .ItemPair> enumerator = ((IEnumerable <SlotVector <PingMapLayer.Ping> .ItemPair>) this._pings).GetEnumerator()) { while (((IEnumerator)enumerator).MoveNext()) { SlotVector <PingMapLayer.Ping> .ItemPair current = enumerator.Current; PingMapLayer.Ping ping = (PingMapLayer.Ping)current.Value; double totalSeconds = (now - ping.Time).TotalSeconds; int num = (int)(totalSeconds * 10.0); frame.CurrentRow = (byte)((uint)num % (uint)frame.RowCount); context.Draw(TextureAssets.MapPing.get_Value(), ping.Position, frame, Alignment.Center); if (totalSeconds > 15.0) { this._pings.Remove((SlotId)current.Id); } } } }