Move getCenteredOn to PartGrid.
This commit is contained in:
parent
d8d641ecf9
commit
53bab05798
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user