public void UnlistenAt(Triggerable listener, ByteVector2 position) { try { Debug.Log("REMOVING LISTENER : " + listeners[position.X, position.Y].Remove(listener)); } catch (System.Exception e) { Debug.Log("ERROR REMOVING LISTENER AT ***************************" + e); } }
public void ListenAt(Triggerable listener, ByteVector2 position) { Debug.Log("TRIG LISTENING"); try { listeners[position.X, position.Y].Add(listener); } catch (System.Exception e) { Debug.Log("ERROR LISTENING AT ***************************" + e); } }
public void TriggerAt(ByteVector2 position, int triggeringFaction) { for (int i = 0; i < listeners[position.X, position.Y].Count; i++) { Triggerable l = listeners[position.X, position.Y][i]; if (l == null) { Debug.Log("ERROR TRIGGERING AT ***************************"); continue; } if (!l.InFaction(triggeringFaction)) // Can't trigger own entities { l.Trigger(); } } }