예제 #1
0
        private static void AlertReceiver_Received(object sender, LightingReceivedEventArgs e)
        {
            var asset = _assetStore.Get(e.Lightning.Latitude, e.Lightning.Longitude, 12);

            if (asset is null)
            {
                return;
            }

            var alreadyAlerted = _alertTracker.Any(a => a == asset.QuadKey);

            if (alreadyAlerted)
            {
                return;
            }

            _alertTracker.Add(asset.QuadKey);

            Console.WriteLine($"lightning alert for {asset.AssetOwner}:{asset.AssetName}");
        }