Move getCenteredOn to PartGrid.

This commit is contained in:
kenkeiras 2018-01-21 23:07:22 +01:00
parent d8d641ecf9
commit 53bab05798
2 changed files with 5 additions and 4 deletions

View File

@ -7,9 +7,9 @@ import com.codigoparallevar.minicards.types.Tuple2;
public abstract class PartInstantiator { public abstract class PartInstantiator {
protected abstract Part instantiate(PartGrid grid, Tuple2<Integer, Integer> center); protected abstract Part instantiate(PartGrid grid, Tuple2<Integer, Integer> center);
public Part build(CanvasView canvasView) { public Part build(PartGrid grid) {
Tuple2<Integer, Integer> center = canvasView.getCenteredOn(); Tuple2<Integer, Integer> center = grid.getCenteredOn();
return instantiate(canvasView, center); return instantiate(grid, center);
} }
} }

View File

@ -1,10 +1,11 @@
package com.codigoparallevar.minicards.types; package com.codigoparallevar.minicards.types;
import com.codigoparallevar.minicards.types.connectors.input.InputConnector;
import com.codigoparallevar.minicards.types.connectors.input.SignalInputConnector; import com.codigoparallevar.minicards.types.connectors.input.SignalInputConnector;
public interface PartGrid { public interface PartGrid {
Selectable getPartOn(int x, int y); Selectable getPartOn(int x, int y);
SignalInputConnector getSignalInputConnectorOn(int x, int y); SignalInputConnector getSignalInputConnectorOn(int x, int y);
Tuple2<Integer,Integer> getCenteredOn();
} }