예제 #1
0
        public Tile GetTile(WallTileData t)
        {
            var logicSensors = t.Actuators
                               .Where(x => x.ActuatorType == 5 || x.ActuatorType == 6)
                               .ToArray();

            if (logicSensors.Any())
            {
                var logicTileInitializer = new LogicTileInitializer();
                initializer = logicTileInitializer;
                logicActuatorCreator.SetLogicActuator(logicTileInitializer, logicSensors);
                return(new LogicTile(logicTileInitializer));
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        private void Initialize(LogicTileInitializer initializer)
        {
            Actuator = initializer.LogicActuator;

            initializer.Initializing -= Initialize;
        }
예제 #3
0
 public LogicTile(LogicTileInitializer initializer) : base(initializer)
 {
     initializer.Initializing += Initialize;
 }
 public async void  SetLogicActuator(LogicTileInitializer initializer, IEnumerable <ActuatorItemData> data)
 {
     initializer.LogicActuator = new LogicActuator(await Task.WhenAll(data.Select(async x => await ParseLogicSensor(x))));
 }