From bfdbc347eb93b89788060270944cbe6f1dc02309 Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Sun, 26 Jan 2025 13:29:41 +0100 Subject: [PATCH] finished rewrite of player planet loading --- Stars Assistant/Services/PlanetManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Stars Assistant/Services/PlanetManager.cs b/Stars Assistant/Services/PlanetManager.cs index bef5ce3..c0631bc 100644 --- a/Stars Assistant/Services/PlanetManager.cs +++ b/Stars Assistant/Services/PlanetManager.cs @@ -25,10 +25,7 @@ public class PlanetManager : IDisposable, IEnableLogger /// Observable changeset showing all player planets converted to view models. /// public IObservable> PlayerPlanetsSource - => _planets - .Connect() - .Filter(planet => planet.OwnerId == Game.Player.Name) - .Transform(planet => new PlayerPlanetViewModel(planet)); + => _playerPlanets.AsObservableCache().Connect(); /// /// Cache with all player planets, indexed by planet name. @@ -64,6 +61,7 @@ public class PlanetManager : IDisposable, IEnableLogger var planetsToDelete = cacheKeys.Except(planetNames); _planets.Edit(innerCache => { + // TODO: Update Planet loop in the same way as the player planet update loop foreach (var name in planetsToDelete) innerCache.RemoveKey(name); innerCache.AddOrUpdate(allPlanets);