private static TroughComponent CreateTrough(TroughData data) { var table = new TableBuilder().AddTrough(data).Build(); var go = VpxImportEngine.ImportIntoScene(table, options: ConvertOptions.SkipNone); var tableComponent = go.GetComponent <TableComponent>(); return(tableComponent.transform.Find($"Playfield/{data.Name}").GetComponent <TroughComponent>()); }
private static void ValidateTroughData(TroughData data) { data.BallCount.Should().Be(3); data.SwitchCount.Should().Be(4); data.SettleTime.Should().Be(112); data.EntryKicker.Should().Be("BallDrain"); data.ExitKicker.Should().Be("BallRelease"); data.JamSwitch.Should().Be("TroughJam"); }
public TableBuilder AddTrough(string name) { var data = new TroughData($"VpeGameItem{_gameItem++}") { Name = name }; _tableContainer.Add(new Trough.Trough(data)); return(this); }
private static void ValidateTroughData(TroughData data) { data.Type.Should().Be(TroughType.ModernOpto); data.BallCount.Should().Be(3); data.SwitchCount.Should().Be(4); data.KickTime.Should().Be(112); data.RollTime.Should().Be(113); data.TransitionTime.Should().Be(114); data.JamSwitch.Should().Be(true); data.PlayfieldEntrySwitch.Should().Be("BallDrain"); data.PlayfieldExitKicker.Should().Be("BallRelease"); }
public void ShouldReturnCorrectCoilsForModernMechanical() { var data = new TroughData("Trough") { Type = TroughType.ModernMech, }; var troughComponent = CreateTrough(data); var coils = troughComponent.AvailableCoils.ToArray(); coils.Should().HaveCount(1); coils[0].Id.Should().Be(TroughComponent.EjectCoilId); }
public void ShouldReturnCorrectSwitchesForClassicSingleBall() { var data = new TroughData("Trough") { Type = TroughType.ClassicSingleBall, }; var troughComponent = CreateTrough(data); var switches = troughComponent.AvailableSwitches.ToArray(); switches.Should().HaveCount(1); switches[0].Id.Should().Be(TroughComponent.EntrySwitchId); }
public void ShouldReturnCorrectCoilsForModernMechanical() { var data = new TroughData("Trough") { Type = TroughType.ModernMech, }; var trough = new Engine.VPT.Trough.Trough(data); var coils = trough.AvailableCoils.ToArray(); coils.Should().HaveCount(1); coils[0].Id.Should().Be(Engine.VPT.Trough.Trough.EjectCoilId); }
public void ShouldReturnCorrectCoilsForTwoCoilsOneSwitch() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsOneSwitch, }; var troughComponent = CreateTrough(data); var coils = troughComponent.AvailableCoils.ToArray(); coils.Should().HaveCount(2); coils[0].Id.Should().Be(TroughComponent.EntryCoilId); coils[1].Id.Should().Be(TroughComponent.EjectCoilId); }
public void ShouldReturnCorrectSwitchesForTwoCoilsOneSwitch() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsOneSwitch, }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); switches.Should().HaveCount(2); switches[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntrySwitchId); switches[1].Id.Should().Be(Engine.VPT.Trough.Trough.TroughSwitchId); }
public void ShouldReturnCorrectCoilsForTwoCoilsNSwitches() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsNSwitches, }; var trough = new Engine.VPT.Trough.Trough(data); var coils = trough.AvailableCoils.ToArray(); coils.Should().HaveCount(2); coils[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntryCoilId); coils[1].Id.Should().Be(Engine.VPT.Trough.Trough.EjectCoilId); }
public void ShouldReturnCorrectSwitchesForTwoCoilsNSwitches() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsNSwitches, SwitchCount = 3 }; var troughComponent = CreateTrough(data); var switches = troughComponent.AvailableSwitches.ToArray(); switches.Should().HaveCount(4); switches[0].Id.Should().Be(TroughComponent.EntrySwitchId); switches[1].Id.Should().Be("ball_switch_1"); switches[2].Id.Should().Be("ball_switch_2"); switches[3].Id.Should().Be("ball_switch_3"); }
public void ShouldReturnCorrectSwitchesForTwoCoilsNSwitches() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsNSwitches, SwitchCount = 3 }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); switches.Should().HaveCount(4); switches[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntrySwitchId); switches[1].Id.Should().Be("1"); switches[2].Id.Should().Be("2"); switches[3].Id.Should().Be("3"); }
private void CreateTrough() { var troughData = new TroughData("Trough"); if (_table.Has <Kicker>("BallRelease")) { troughData.ExitKicker = "BallRelease"; } if (_table.Has <Kicker>("Drain")) { troughData.EntryKicker = "Drain"; } var item = new Trough(troughData); _table.Add(item, true); CreateGameObjects(_tableAuthoring.Table, item, _tableAuthoring.gameObject); }
public void ShouldReturnCorrectSwitchesForModernMechanical() { var data = new TroughData("Trough") { TransitionTime = 100, RollTime = 1000, Type = TroughType.ModernMech, SwitchCount = 3 }; var troughComponent = CreateTrough(data); var switches = troughComponent.AvailableSwitches.ToArray(); troughComponent.RollTimeDisabled.Should().Be(500); troughComponent.RollTimeEnabled.Should().Be(500); switches.Should().HaveCount(3); switches[0].Id.Should().Be("ball_switch_1"); switches[1].Id.Should().Be("ball_switch_2"); switches[2].Id.Should().Be("ball_switch_3"); }
public void ShouldReturnCorrectSwitchesForModernMechanical() { var data = new TroughData("Trough") { TransitionTime = 100, RollTime = 1000, Type = TroughType.ModernMech, SwitchCount = 3 }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); trough.RollTimeDisabled.Should().Be(500); trough.RollTimeEnabled.Should().Be(500); switches.Should().HaveCount(3); switches[0].Id.Should().Be("1"); switches[1].Id.Should().Be("2"); switches[2].Id.Should().Be("3"); }
public TableBuilder AddTrough(TroughData data) { _tableContainer.Add(new Trough.Trough(data)); return(this); }