Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
            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();
                    }
                }
            }