2018-01-20 23:14:46 +00:00
|
|
|
package com.codigoparallevar.minicards;
|
|
|
|
|
|
|
|
import com.codigoparallevar.minicards.types.Part;
|
|
|
|
import com.codigoparallevar.minicards.types.PartGrid;
|
|
|
|
import com.codigoparallevar.minicards.types.Tuple2;
|
|
|
|
|
|
|
|
public abstract class PartInstantiator {
|
|
|
|
protected abstract Part instantiate(PartGrid grid, Tuple2<Integer, Integer> center);
|
|
|
|
|
2018-01-21 22:07:22 +00:00
|
|
|
public Part build(PartGrid grid) {
|
|
|
|
Tuple2<Integer, Integer> center = grid.getCenteredOn();
|
2018-01-20 23:14:46 +00:00
|
|
|
|
2018-01-21 22:07:22 +00:00
|
|
|
return instantiate(grid, center);
|
2018-01-20 23:14:46 +00:00
|
|
|
}
|
|
|
|
}
|