diff --git a/app/src/main/java/com/codigoparallevar/minicards/PartInstantiator.java b/app/src/main/java/com/codigoparallevar/minicards/PartInstantiator.java index 87804c7..4338730 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/PartInstantiator.java +++ b/app/src/main/java/com/codigoparallevar/minicards/PartInstantiator.java @@ -7,9 +7,9 @@ import com.codigoparallevar.minicards.types.Tuple2; public abstract class PartInstantiator { protected abstract Part instantiate(PartGrid grid, Tuple2 center); - public Part build(CanvasView canvasView) { - Tuple2 center = canvasView.getCenteredOn(); + public Part build(PartGrid grid) { + Tuple2 center = grid.getCenteredOn(); - return instantiate(canvasView, center); + return instantiate(grid, center); } } diff --git a/app/src/main/java/com/codigoparallevar/minicards/types/PartGrid.java b/app/src/main/java/com/codigoparallevar/minicards/types/PartGrid.java index 2502b0c..ad098be 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/types/PartGrid.java +++ b/app/src/main/java/com/codigoparallevar/minicards/types/PartGrid.java @@ -1,10 +1,11 @@ package com.codigoparallevar.minicards.types; -import com.codigoparallevar.minicards.types.connectors.input.InputConnector; import com.codigoparallevar.minicards.types.connectors.input.SignalInputConnector; public interface PartGrid { Selectable getPartOn(int x, int y); SignalInputConnector getSignalInputConnectorOn(int x, int y); + + Tuple2 getCenteredOn(); }