finished rewrite of player planet loading
This commit is contained in:
parent
8f63587966
commit
bfdbc347eb
@ -25,10 +25,7 @@ public class PlanetManager : IDisposable, IEnableLogger
|
||||
/// Observable changeset showing all player planets converted to view models.
|
||||
/// </summary>
|
||||
public IObservable<IChangeSet<PlayerPlanetViewModel, string>> PlayerPlanetsSource
|
||||
=> _planets
|
||||
.Connect()
|
||||
.Filter(planet => planet.OwnerId == Game.Player.Name)
|
||||
.Transform(planet => new PlayerPlanetViewModel(planet));
|
||||
=> _playerPlanets.AsObservableCache().Connect();
|
||||
|
||||
/// <summary>
|
||||
/// 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);
|
||||
|
Loading…
Reference in New Issue
Block a user