From 99736f114db2f858856dde21469d8dd1ec77d298 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Fri, 6 Jun 2025 19:32:42 +0800 Subject: [PATCH] style: Code cleanup --- Assets/Cryville.EEW.Unity/Worker.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Cryville.EEW.Unity/Worker.cs b/Assets/Cryville.EEW.Unity/Worker.cs index 04c291b..75f3333 100644 --- a/Assets/Cryville.EEW.Unity/Worker.cs +++ b/Assets/Cryville.EEW.Unity/Worker.cs @@ -150,26 +150,26 @@ namespace Cryville.EEW.Unity { #else foreach (var source in SharedSettings.Instance.EventSources) { _worker.AddWorker(source switch { - BMKGOpenDataEventSourceConfig bmkgOpenData => BuildBMKGOpenDataWorkerUris(new BMKGOpenDataWorker(new("https://data.bmkg.go.id/DataMKG/TEWS/autogempa.json")), bmkgOpenData), + BMKGOpenDataEventSourceConfig bmkgOpenData => BuildBMKGOpenDataWorkerUris(new(new("https://data.bmkg.go.id/DataMKG/TEWS/autogempa.json")), bmkgOpenData), CWAOpenDataEventSourceConfig cwaOpenData => cwaOpenData.Subtype switch { - "E-A0014-001" => new CWAReportWorker(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0014-001"), cwaOpenData.Token, 1440, 17280), - "E-A0015-001" => new CWAReportWorker(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001"), cwaOpenData.Token), - "E-A0016-001" => new CWAReportWorker(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0016-001"), cwaOpenData.Token), + "E-A0014-001" => new CWAReportWorker(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0014-001"), cwaOpenData.Token, 1440, 17280), + "E-A0015-001" => new CWAReportWorker(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001"), cwaOpenData.Token), + "E-A0016-001" => new CWAReportWorker(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0016-001"), cwaOpenData.Token), _ => throw new InvalidOperationException("Unknown CWA open data sub-type."), }, EMSCRealTimeEventSourceConfig => new EMSCRealTimeWorker(new("wss://www.seismicportal.eu/standing_order/websocket")), GeoNetEventSourceConfig geoNet => BuildGeoNetWorker(new(new("https://api.geonet.org.nz/quake"), new("https://api.geonet.org.nz/quake/history/index"), new("https://api.geonet.org.nz/intensity/strong/processed/index")), geoNet), GlobalQuakeServer15EventSourceConfig gq => new GlobalQuakeWorker15(gq.Host, gq.Port), GlobalQuakeServerEventSourceConfig gq => new GlobalQuakeWorker(gq.Host, gq.Port), - JMAAtomEventSourceConfig jmaAtom => BuildJMAAtomWorkerFilter(new JMAAtomWorker(new("https://www.data.jma.go.jp/developer/xml/feed/eqvol.xml")), jmaAtom), + JMAAtomEventSourceConfig jmaAtom => BuildJMAAtomWorkerFilter(new(new("https://www.data.jma.go.jp/developer/xml/feed/eqvol.xml")), jmaAtom), NOAAEventSourceConfig noaaAtom => noaaAtom.Subtype switch { "PAAQ" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PAAQAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PAAQ"), "PHEB" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PHEBAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PHEB"), _ => throw new InvalidOperationException("Unknown NOAA sub-type."), }, UpdateCheckerEventSourceConfig => new UpdateCheckerWorker(typeof(Worker).Assembly.GetName().Version?.ToString(3) ?? "", "unity"), - USGSQuakeMLEventSourceConfig usgsQuakeML => BuildUSGSQuakeMLWorkerUri(new USGSQuakeMLWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php")), usgsQuakeML), - WolfxEventSourceConfig wolfx => BuildWolfxWorkerFilter(new WolfxWorker(new Uri("wss://ws-api.wolfx.jp/all_eew")), wolfx), + USGSQuakeMLEventSourceConfig usgsQuakeML => BuildUSGSQuakeMLWorkerUri(new USGSQuakeMLWorker(new("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php")), usgsQuakeML), + WolfxEventSourceConfig wolfx => BuildWolfxWorkerFilter(new WolfxWorker(new("wss://ws-api.wolfx.jp/all_eew")), wolfx), _ => throw new InvalidOperationException("Unknown event source type."), }); }