Refactor input interfaces in :api

This commit is contained in:
2021-03-03 13:49:07 +01:00
parent ed180b2bc4
commit 01e4beac0a
8 changed files with 146 additions and 171 deletions

View File

@@ -1,5 +0,0 @@
package com.bartlomiejpluta.base.api.game.input;
public interface Keyboard {
boolean isKeyPressed(Key key);
}

View File

@@ -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);
}

View File

@@ -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();