private static LinesSourceManager CreateManager(ISelkieLogger logger,
                                                 ISelkieBus bus)
 {
     return CreateManager(logger,
                          bus,
                          Substitute.For <ISelkieInMemoryBus>());
 }
        private static LinesSourceManager CreateManager(ISelkieLogger logger,
                                                        ISelkieBus bus,
                                                        ISelkieInMemoryBus inMemoryBus)
        {
            var factory = Substitute.For <ILinesSourceFactory>();
            factory.Create(Arg.Any <IEnumerable <ILine>>()).Returns(CreateLinesSource);

            var converter = new TestLinesDtoToLinesConverter();

            return new LinesSourceManager(logger,
                                          bus,
                                          inMemoryBus,
                                          factory,
                                          converter);
        }
        public CalculateCostMatrixManager([NotNull] ISelkieLogger logger,
                                          [NotNull] ISelkieBus bus,
                                          [NotNull] ILinesSourceManager linesSourceManager,
                                          [NotNull] IRacetrackSettingsSourceManager racetrackSettingsSourceManager)
        {
            m_Logger = logger;
            m_Bus = bus;
            m_LinesSourceManager = linesSourceManager;
            m_RacetrackSettingsSourceManager = racetrackSettingsSourceManager;

            string subscriptionId = GetType().FullName;

            m_Bus.SubscribeAsync <ColonyLinesChangedMessage>(subscriptionId,
                                                             ColonyLinesChangedHandler);

            m_Bus.SubscribeAsync <ColonyRacetrackSettingsChangedMessage>(subscriptionId,
                                                                         ColonyRacetrackSettingsChangedHandler);
        }
        public CostMatrixSourceManager([NotNull] ISelkieLogger logger,
                                       [NotNull] ISelkieBus bus,
                                       [NotNull] ICalculateCostMatrixManager calculateCostMatrixManager,
                                       [NotNull] IDoubleArrayToIntegerArrayConverter converter)
        {
            m_Logger = logger;
            m_Bus = bus;
            m_CalculateCostMatrixManager = calculateCostMatrixManager;
            m_Converter = converter;

            string subscriptionId = GetType().FullName;

            m_Bus.SubscribeAsync <CostMatrixChangedMessage>(subscriptionId,
                                                            CostMatrixChangedHandler);

            m_Bus.SubscribeAsync <ColonyLinesChangedMessage>(subscriptionId,
                                                             ColonyLinesChangedHandler);

            m_Bus.SubscribeAsync <ColonyRacetrackSettingsChangedMessage>(subscriptionId,
                                                                         ColonyRacetrackSettingsChangedHandler);

            m_CalculateCostMatrixManager.Calculate();
        }