using Microsoft.Extensions.Logging; using Tiger.Game.Navigator.Nodes; using Tiger.Storage; namespace Tiger.Game.Navigator; public class NavigatorManager : INavigatorManager { private readonly IRepository _navigatorNodeRepository; private readonly ILogger _logger; public IDictionary NavigatorNodes { get; private set; } public NavigatorManager(IRepository navigatorNodeRepository, ILogger logger) { _navigatorNodeRepository = navigatorNodeRepository; _logger = logger; NavigatorNodes = new Dictionary(); } public async Task LoadNodesAsync() { NavigatorNodes = (await _navigatorNodeRepository.FindByAsync()).ToDictionary(nn => nn.Id); _logger.LogInformation("Loaded {Count} navigator nodes", NavigatorNodes.Count); } }