Beispiel #1
0
        public ISpectrum CreateSpectrum(WaveSpectrumConditionKey key)
        {
            CustomWaveSpectrumExample.CustomSpectrumConditionKey customSpectrumConditionKey = key as CustomWaveSpectrumExample.CustomSpectrumConditionKey;
            if (customSpectrumConditionKey == null)
            {
                throw new InvalidCastException("Spectrum condition key is null or not the correct type");
            }
            float num     = customSpectrumConditionKey.WindSpeed;
            float windDir = customSpectrumConditionKey.WindDir;

            return(new CustomWaveSpectrumExample.CustomSpectrum(num, windDir));
        }
Beispiel #2
0
 protected override bool Matches(WaveSpectrumConditionKey k)
 {
     CustomWaveSpectrumExample.CustomSpectrumConditionKey customSpectrumConditionKey = k as CustomWaveSpectrumExample.CustomSpectrumConditionKey;
     return(!(customSpectrumConditionKey == null) && this.WindSpeed == customSpectrumConditionKey.WindSpeed);
 }