Refactor input interfaces in :api
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
package com.bartlomiejpluta.base.api.game.input;
|
||||
|
||||
public interface Keyboard {
|
||||
boolean isKeyPressed(Key key);
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.bartlomiejpluta.base.api.game.map;
|
||||
|
||||
import com.bartlomiejpluta.base.api.game.context.Context;
|
||||
import com.bartlomiejpluta.base.api.game.input.Keyboard;
|
||||
import com.bartlomiejpluta.base.api.internal.window.Window;
|
||||
|
||||
public interface MapHandler {
|
||||
void init(Context context, GameMap map);
|
||||
|
||||
void input(Keyboard keyboard);
|
||||
void input(Window window);
|
||||
|
||||
void update(Context context, GameMap map, float dt);
|
||||
|
||||
void postRender(float windowWidth, float windowHeight);
|
||||
void postRender(Window window);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.bartlomiejpluta.base.api.internal.window;
|
||||
|
||||
import com.bartlomiejpluta.base.api.game.input.Key;
|
||||
import org.joml.Vector2f;
|
||||
|
||||
public interface Window {
|
||||
@@ -17,7 +18,7 @@ public interface Window {
|
||||
|
||||
boolean shouldClose();
|
||||
|
||||
boolean isKeyPressed(int keyCode);
|
||||
boolean isKeyPressed(Key key);
|
||||
|
||||
void update();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user