示例#1
0
    public Receiver TryTransmit(TransmissionType t, Receiver targetReceiver)
    {
        //If we don't actually have the ability to transmit, do nothing.
        if (!MyActionBank.HasAction(t))
        {
            return(null);
        }

        //If the receiver cannot receive the transmission, do nothing.
        if (!targetReceiver.CanReceive(t))
        {
            return(null);
        }

        if (targetReceiver.ReceiveTransmission(t))
        {
            MyActionBank.RemoveAction(t);
        }
        return(targetReceiver);
    }
示例#2
0
 public bool CanTransmit(TransmissionType t)
 {
     return(RemainingCD <= 0f && MyActionBank.HasAction(t));
 }