예제 #1
0
        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>());
        }
예제 #2
0
 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");
 }
예제 #3
0
        public TableBuilder AddTrough(string name)
        {
            var data = new TroughData($"VpeGameItem{_gameItem++}")
            {
                Name = name
            };

            _tableContainer.Add(new Trough.Trough(data));
            return(this);
        }
예제 #4
0
 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");
 }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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");
        }
예제 #12
0
        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");
        }
예제 #13
0
        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);
        }
예제 #14
0
        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");
        }
예제 #15
0
        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");
        }
예제 #16
0
 public TableBuilder AddTrough(TroughData data)
 {
     _tableContainer.Add(new Trough.Trough(data));
     return(this);
 }