public virtual Dictionary <int, IShip> GetShips() { Dictionary <int, IShip> ships; if (_isShipCacheReady) { return(new Dictionary <int, IShip>(_shipCache)); } _shipCache.Clear(); ships = new Dictionary <int, IShip>(_onlinePlayerIDs.Count); var sl = _shipLocator.GetShipsAsync(_model.ShipIDs).Result; foreach (var s in sl) { ships.Add(s.Id, s); _shipCache.Add(s.Id, s); } _isShipCacheReady = true; return(ships); }