Skip to content

Commit

Permalink
cleanup: Remove ITargetData.
Browse files Browse the repository at this point in the history
  • Loading branch information
freezy committed Jan 11, 2025
1 parent 5d7fb38 commit c867a42
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 48 deletions.
25 changes: 0 additions & 25 deletions VisualPinball.Engine/VPT/HitTarget/ITargetData.cs

This file was deleted.

11 changes: 0 additions & 11 deletions VisualPinball.Engine/VPT/HitTarget/ITargetData.cs.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
namespace VisualPinball.Unity
{
public abstract class TargetComponent : MainRenderableComponent<HitTargetData>,
ISwitchDeviceComponent, ITargetData, IMeshGenerator
ISwitchDeviceComponent, IMeshGenerator
{
#region Data

Expand Down

0 comments on commit c867a42

Please sign in to comment.