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); } }
private void Initialize(LogicTileInitializer initializer) { Actuator = initializer.LogicActuator; initializer.Initializing -= Initialize; }
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)))); }