コード例 #1
0
ファイル: ATMap.cs プロジェクト: hoffmannj/ATM
 internal ATMap(ATMMain mapper)
 {
     getFunction           = GetWithInitialization;
     thisFactory           = this as IATMFactory <T>;
     thisValidate          = this as IATMValidate;
     this.mapper           = mapper;
     this.baseType         = typeof(T);
     constructorParameters = new Dictionary <string, IGeneratorFunc>();
 }
コード例 #2
0
        public ATMSystem(IATMFactory factory, ITransponderReceiver transponderReceiver)
        {
            //Calling factory methods
            receiver           = transponderReceiver;
            _airSpace          = factory.CreateAirSpace();
            _condition         = factory.CreateCondition();
            _consolePrinter    = factory.CreateConsolePrinter();
            _logger            = factory.CreateLogger();
            _separationChecker = factory.CreateSeparationChecker();

            //Subscribing to events
            this.receiver.TransponderDataReady += ReceiverOnTransponderReady;
            this.SeparationLogDataReady        += _logger.SeparationLogDataHandler;
            this.ConsoleSeparationDataReady    += _consolePrinter.ConsoleSeparationDataHandler;
        }
コード例 #3
0
ファイル: ATMap.cs プロジェクト: hoffmannj/ATM
        private bool TryGetFirstMapForType(Type type, List <IATMap> chain, out IATMFactory map)
        {
            map = null;
            var maps = mapper.GetMapsForType(type);

            if (maps == null)
            {
                return(false);
            }
            mapper.AssertOnlyOneMap(maps);
            var firstMap = maps[0];

            if (!(firstMap as IATMValidate).Validate(chain))
            {
                return(false);
            }
            map = firstMap;
            return(true);
        }