private static void ListenForDestruction(TileDestroyedCondition condition) { if (!_isListenerHooked) { AchievementsHelper.OnTileDestroyed += new AchievementsHelper.TileDestroyedEvent(TileDestroyedListener); _isListenerHooked = true; } for (int index = 0; index < condition._tileIds.Length; ++index) { if (!_listeners.ContainsKey(condition._tileIds[index])) _listeners[condition._tileIds[index]] = new List<TileDestroyedCondition>(); _listeners[condition._tileIds[index]].Add(condition); } }
private static void ListenForDestruction(TileDestroyedCondition condition) { if (!_isListenerHooked) { AchievementsHelper.OnTileDestroyed += TileDestroyedListener; _isListenerHooked = true; } for (int i = 0; i < condition._tileIds.Length; i++) { if (!_listeners.ContainsKey(condition._tileIds[i])) { _listeners[condition._tileIds[i]] = new List <TileDestroyedCondition>(); } _listeners[condition._tileIds[i]].Add(condition); } }
private static void ListenForDestruction(TileDestroyedCondition condition) { if (!TileDestroyedCondition._isListenerHooked) { AchievementsHelper.OnTileDestroyed += new AchievementsHelper.TileDestroyedEvent(TileDestroyedCondition.TileDestroyedListener); TileDestroyedCondition._isListenerHooked = true; } for (int index = 0; index < condition._tileIds.Length; ++index) { if (!TileDestroyedCondition._listeners.ContainsKey(condition._tileIds[index])) { TileDestroyedCondition._listeners[condition._tileIds[index]] = new List <TileDestroyedCondition>(); } TileDestroyedCondition._listeners[condition._tileIds[index]].Add(condition); } }
private static void ListenForDestruction(TileDestroyedCondition condition) { if (!TileDestroyedCondition._isListenerHooked) { AchievementsHelper.OnTileDestroyed += new AchievementsHelper.TileDestroyedEvent(TileDestroyedCondition.TileDestroyedListener); TileDestroyedCondition._isListenerHooked = true; } for (int i = 0; i < condition._tileIds.Length; i++) { if (!TileDestroyedCondition._listeners.ContainsKey(condition._tileIds[i])) { TileDestroyedCondition._listeners[condition._tileIds[i]] = new List<TileDestroyedCondition>(); } TileDestroyedCondition._listeners[condition._tileIds[i]].Add(condition); } }
private TileDestroyedCondition(ushort[] tileIds) : base("TILE_DESTROYED_" + (object)tileIds[0]) { this._tileIds = tileIds; TileDestroyedCondition.ListenForDestruction(this); }
private TileDestroyedCondition(ushort[] tileIds) : base(string.Concat("TILE_DESTROYED_", tileIds[0])) { this._tileIds = tileIds; TileDestroyedCondition.ListenForDestruction(this); }