public RumbleSection Migrate(RumbleSectionV1 oldRumbleSection) { if (oldRumbleSection == null) { return null; } var newRumbleSectionBuilder = new RumbleSectionBuilder(); var oldRumble = oldRumbleSection.Rumble; if (oldRumble == null) { return null; } var newRumble = new Rumble() { RumbleType = oldRumble.RumbleType, Intensity = oldRumble.Intensity, Speed = oldRumble.Speed }; newRumbleSectionBuilder.WithRumbleInDirection(eDirection.Center, newRumble); return newRumbleSectionBuilder.Build(); }
private RumbleSection GetRumbleSection(bool rumbleEnabled, Rumble enabledRumble) { var rumble = rumbleEnabled ? enabledRumble : DefaultRumbles.Off; return rumbleSectionBuilder.WithRumbleInDirection(eDirection.Center, rumble) .Build(); }
public RumbleSectionBuilder WithRumbleInDirection(eDirection direction, Rumble rumble) { if (rumbleSection.GetComponentSectionInDirection(direction) != null) { throw new ArgumentException("Attempted to add multiple Rumbles in the same direction"); } rumble.Direction = direction; rumbleSection.Rumbles.Add(rumble); return this; }
public void UpdateRumble(Rumble inputRumble) { var rumble = rumbles[inputRumble.Direction]; rumble.RumbleSetting = new amBXRumbleSetting { Intensity = inputRumble.Intensity, Speed = inputRumble.Speed, Type = (RumbleType)inputRumble.RumbleType }; }
private void UpdateRumble(Rumble rumble) { Updated[eComponentType.Rumble] = true; Status.RumbleSection.Rumbles.Add(rumble); }