From c867a4266c5452086148f2faf71d2bdf4080ab8a Mon Sep 17 00:00:00 2001 From: freezy Date: Sat, 11 Jan 2025 01:10:42 +0100 Subject: [PATCH] cleanup: Remove ITargetData. --- .../VPT/HitTarget/ITargetData.cs | 25 ------------------- .../VPT/HitTarget/ITargetData.cs.meta | 11 -------- .../VPT/HitTarget/DropTargetApi.cs | 2 +- .../HitTarget/DropTargetColliderGenerator.cs | 4 +-- .../VPT/HitTarget/HitTargetApi.cs | 2 +- .../HitTarget/HitTargetColliderGenerator.cs | 5 ++-- .../VPT/HitTarget/TargetColliderGenerator.cs | 6 ++--- .../VPT/HitTarget/TargetComponent.cs | 2 +- 8 files changed, 9 insertions(+), 48 deletions(-) delete mode 100644 VisualPinball.Engine/VPT/HitTarget/ITargetData.cs delete mode 100644 VisualPinball.Engine/VPT/HitTarget/ITargetData.cs.meta diff --git a/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs b/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs deleted file mode 100644 index 9f610f0c3..000000000 --- a/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Visual Pinball Engine -// Copyright (C) 2023 freezy and VPE Team -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -namespace VisualPinball.Engine.VPT.HitTarget -{ - public interface ITargetData - { - bool IsLegacy { get; } - - int TargetType { get; } - } -} diff --git a/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs.meta b/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs.meta deleted file mode 100644 index 4596aeba0..000000000 --- a/VisualPinball.Engine/VPT/HitTarget/ITargetData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5639b9278ab940846afef61c8d5018e7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetApi.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetApi.cs index 98cba0a4b..b13021906 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetApi.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetApi.cs @@ -105,7 +105,7 @@ private void SetIsDropped(bool isDropped) protected override void CreateColliders(ref ColliderReference colliders, float4x4 translateWithinPlayfieldMatrix, float margin) { - var colliderGenerator = new DropTargetColliderGenerator(this, MainComponent, MainComponent, translateWithinPlayfieldMatrix); + var colliderGenerator = new DropTargetColliderGenerator(this, MainComponent, translateWithinPlayfieldMatrix); colliderGenerator.GenerateColliders(ref colliders); } diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetColliderGenerator.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetColliderGenerator.cs index 46cdedebb..9d1d4764e 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetColliderGenerator.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/DropTargetColliderGenerator.cs @@ -24,8 +24,8 @@ namespace VisualPinball.Unity { public class DropTargetColliderGenerator : TargetColliderGenerator { - public DropTargetColliderGenerator(IApiColliderGenerator api, ITargetData data, IMeshGenerator meshProvider, float4x4 matrix) - : base(api, data, meshProvider, matrix) { } + public DropTargetColliderGenerator(IApiColliderGenerator api, TargetComponent comp, float4x4 matrix) + : base(api, comp, matrix) { } internal void GenerateColliders(ref ColliderReference colliders) { diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetApi.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetApi.cs index 564c5400b..20dbc8c16 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetApi.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetApi.cs @@ -62,7 +62,7 @@ internal HitTargetApi(GameObject go, Player player, PhysicsEngine physicsEngine) protected override void CreateColliders(ref ColliderReference colliders, float4x4 translateWithinPlayfieldMatrix, float margin) { - var colliderGenerator = new HitTargetColliderGenerator(ColliderComponent.ColliderMesh, this, MainComponent, MainComponent, translateWithinPlayfieldMatrix); + var colliderGenerator = new HitTargetColliderGenerator(ColliderComponent.ColliderMesh, this, MainComponent, translateWithinPlayfieldMatrix); colliderGenerator.GenerateColliders(ref colliders); } diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetColliderGenerator.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetColliderGenerator.cs index 4b906bc4f..e5d4c7881 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetColliderGenerator.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/HitTargetColliderGenerator.cs @@ -27,9 +27,8 @@ public class HitTargetColliderGenerator : TargetColliderGenerator { private readonly Mesh _colliderMesh; - public HitTargetColliderGenerator(Mesh colliderMesh, IApiColliderGenerator api, ITargetData data, - IMeshGenerator meshProvider, float4x4 matrix) - : base(api, data, meshProvider, matrix) + public HitTargetColliderGenerator(Mesh colliderMesh, IApiColliderGenerator api, TargetComponent comp, float4x4 matrix) + : base(api, comp, matrix) { _colliderMesh = colliderMesh; } diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetColliderGenerator.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetColliderGenerator.cs index 43dbeba74..30ad193de 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetColliderGenerator.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetColliderGenerator.cs @@ -23,15 +23,13 @@ namespace VisualPinball.Unity public abstract class TargetColliderGenerator { protected readonly IApiColliderGenerator Api; - protected readonly ITargetData Data; - protected readonly IMeshGenerator MeshGenerator; + protected readonly TargetComponent Data; protected readonly float4x4 Matrix; - protected TargetColliderGenerator(IApiColliderGenerator api, ITargetData data, IMeshGenerator meshGenerator, float4x4 matrix) + protected TargetColliderGenerator(IApiColliderGenerator api, TargetComponent data, float4x4 matrix) { Api = api; Data = data; - MeshGenerator = meshGenerator; Matrix = matrix; } diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetComponent.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetComponent.cs index f84318b66..27b3ff281 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetComponent.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/HitTarget/TargetComponent.cs @@ -36,7 +36,7 @@ namespace VisualPinball.Unity { public abstract class TargetComponent : MainRenderableComponent, - ISwitchDeviceComponent, ITargetData, IMeshGenerator + ISwitchDeviceComponent, IMeshGenerator { #region Data