public PlayerGameState()
        {
            radios[0] = new RadioInformation()
            {
                channel    = -1,
                expansion  = false,
                freq       = 10000,
                freqMode   = RadioInformation.FreqMode.OVERLAY,
                freqMax    = 10000,
                freqMin    = 10000,
                modulation = RadioInformation.Modulation.INTERCOM,
                volMode    = RadioInformation.VolumeMode.OVERLAY,
                volume     = 1.0f,
                name       = "INTERCOM",
            };

            radios[1] = new RadioInformation()
            {
                channel    = 1,
                expansion  = false,
                freq       = START_FREQ + CHANNEL_OFFSET,//add offset as channel 1
                freqMode   = RadioInformation.FreqMode.OVERLAY,
                freqMax    = 3e+8,
                freqMin    = 2e+8,
                modulation = RadioInformation.Modulation.AM,
                volMode    = RadioInformation.VolumeMode.OVERLAY,
                volume     = 1.0f,
                name       = "RADIO 1",
            };
            radios[2] = new RadioInformation()
            {
                channel    = 1,
                expansion  = false,
                freq       = START_FREQ + CHANNEL_OFFSET,//add offset as channel 1
                freqMode   = RadioInformation.FreqMode.OVERLAY,
                freqMax    = 3e+8,
                freqMin    = 2e+8,
                modulation = RadioInformation.Modulation.DISABLED,
                volMode    = RadioInformation.VolumeMode.OVERLAY,
                volume     = 1.0f,
                name       = "RADIO 2",
            };
        }
        public RadioInformation CanHearTransmission(double frequency,
                                                    RadioInformation.Modulation modulation,
                                                    long sendingUnitId,
                                                    long sendingVehicleId,
                                                    List <int> blockedRadios,
                                                    out RadioReceivingState receivingState)
        {
            RadioInformation    bestMatchingRadio      = null;
            RadioReceivingState bestMatchingRadioState = null;

            for (var i = 0; i < radios.Length; i++)
            {
                var receivingRadio = radios[i];

                if (receivingRadio != null)
                {
                    //handle INTERCOM Modulation is 2
                    if ((receivingRadio.modulation == RadioInformation.Modulation.INTERCOM) &&
                        (modulation == RadioInformation.Modulation.INTERCOM))
                    {
                        if (((unitId == vehicleId && unitId > -1) ||
                             (vehicleId == sendingVehicleId && vehicleId > -1)))
                        {
                            receivingState = new RadioReceivingState
                            {
                                IsSecondary    = false,
                                LastReceivedAt = DateTime.Now.Ticks,
                                ReceivedOn     = i
                            };
                            return(receivingRadio);
                        }
                        receivingState = null;
                        return(null);
                    }

                    if (modulation == RadioInformation.Modulation.DISABLED ||
                        receivingRadio.modulation == RadioInformation.Modulation.DISABLED)
                    {
                        continue;
                    }

                    //within 1khz
                    if ((FreqCloseEnough(receivingRadio.freq, frequency)) &&
                        (receivingRadio.modulation == modulation) &&
                        (receivingRadio.freq > 10000))
                    {
                        if (!blockedRadios.Contains(i))
                        {
                            receivingState = new RadioReceivingState
                            {
                                IsSecondary    = false,
                                LastReceivedAt = DateTime.Now.Ticks,
                                ReceivedOn     = i
                            };
                            return(receivingRadio);
                        }

                        bestMatchingRadio      = receivingRadio;
                        bestMatchingRadioState = new RadioReceivingState
                        {
                            IsSecondary    = false,
                            LastReceivedAt = DateTime.Now.Ticks,
                            ReceivedOn     = i
                        };
                    }
                }
            }
            receivingState = bestMatchingRadioState;
            return(bestMatchingRadio);
        }