public FanSection Migrate(FanSectionV1 oldFanSection) { if (oldFanSection == null) { return null; } var newFanSectionBuilder = new FanSectionBuilder(); foreach (var direction in EnumExtensions.GetCompassDirections()) { var oldFan = (FanV1)oldFanSection.GetComponentValueInDirection(direction); if (oldFan == null) { continue; } var newFan = new Fan() { Intensity = oldFan.Intensity }; newFanSectionBuilder.WithFanInDirection(direction, newFan); } return newFanSectionBuilder.Build(); }
public void Setup() { sectionBuilder = new FanSectionBuilder(); }