public static void ChangeFrequency(
     int oldFrequency,
     int newFrequency,
     IRFObject obj,
     bool isListener,
     bool isOn = true)
 {
     newFrequency = RFManager.ClampFrequency(newFrequency);
     if (isListener)
     {
         RFManager.RemoveListener(oldFrequency, obj);
         if (!isOn)
         {
             return;
         }
         RFManager.AddListener(newFrequency, obj);
     }
     else
     {
         RFManager.RemoveBroadcaster(oldFrequency, obj);
         if (!isOn)
         {
             return;
         }
         RFManager.AddBroadcaster(newFrequency, obj);
     }
 }
Exemple #2
0
 internal void InternalSetPressed(bool pressed)
 {
     base.SetFlag(BaseEntity.Flags.On, pressed, false, true);
     if (pressed)
     {
         RFManager.AddBroadcaster(this.frequency, this);
         return;
     }
     RFManager.RemoveBroadcaster(this.frequency, this);
 }
 internal void InternalSetPressed(bool pressed)
 {
     this.SetFlag(BaseEntity.Flags.On, pressed, false, true);
     if (pressed)
     {
         RFManager.AddBroadcaster(this.frequency, (IRFObject)this);
     }
     else
     {
         RFManager.RemoveBroadcaster(this.frequency, (IRFObject)this);
     }
 }
Exemple #4
0
 internal void InternalSetPressed(bool pressed)
 {
     SetFlag(Flags.On, pressed);
     if (pressed)
     {
         RFManager.AddBroadcaster(frequency, this);
     }
     else
     {
         RFManager.RemoveBroadcaster(frequency, this);
     }
 }
 internal override void DoServerDestroy()
 {
     RFManager.RemoveBroadcaster(this.frequency, this);
     base.DoServerDestroy();
 }
 public void StopBroadcasting()
 {
     base.SetFlag(BaseEntity.Flags.Reserved3, false, false, true);
     RFManager.RemoveBroadcaster(this.frequency, this);
 }