I am currently moving all my Game code to another package so that I can simply reuse it when I create another similar game.
I am having some problems with this though.
public interface Sprite {
...
}
abstract class AbstractSprite implements Sprite {
...
}
public interface Builder<T> {
public T build();
}
class GameObjectImpl extends AbstractSprite {
public static class GameObjectBuilder implements Builder<GameObjectImpl> {
...
}
}
I am using a Builder Pattern to create my GameObjectImpl objects. However, the client (the person using my game engine) will only have access to the Sprite interface.
How can I get the client to create GameObjectImpl using builder and only having access to the Sprite Interface?