From 5b4d135eed6ebe8a32c283677592eed6bb851e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 9 Oct 2018 11:44:52 +0200 Subject: clean up basic interfaces --- core/src/ch/asynk/gdx/boardgame/Drawable.java | 1 + core/src/ch/asynk/gdx/boardgame/Paddable.java | 1 + core/src/ch/asynk/gdx/boardgame/Positionable.java | 4 +++- core/src/ch/asynk/gdx/boardgame/Rotable.java | 6 ++++++ core/src/ch/asynk/gdx/boardgame/Scalable.java | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 core/src/ch/asynk/gdx/boardgame/Rotable.java diff --git a/core/src/ch/asynk/gdx/boardgame/Drawable.java b/core/src/ch/asynk/gdx/boardgame/Drawable.java index 8c53e62..873e47f 100644 --- a/core/src/ch/asynk/gdx/boardgame/Drawable.java +++ b/core/src/ch/asynk/gdx/boardgame/Drawable.java @@ -6,5 +6,6 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public interface Drawable { public void draw(Batch batch); + default public void setAlpha(float alpha) { } default public void drawDebug(ShapeRenderer debugShapes) { } } diff --git a/core/src/ch/asynk/gdx/boardgame/Paddable.java b/core/src/ch/asynk/gdx/boardgame/Paddable.java index 344c4ff..988d344 100644 --- a/core/src/ch/asynk/gdx/boardgame/Paddable.java +++ b/core/src/ch/asynk/gdx/boardgame/Paddable.java @@ -7,5 +7,6 @@ public interface Paddable public float getInnerWidth(); public float getInnerHeight(); public void setPadding(float padding); + public void setPosition(float x, float y, float w, float h); } diff --git a/core/src/ch/asynk/gdx/boardgame/Positionable.java b/core/src/ch/asynk/gdx/boardgame/Positionable.java index d16f5ce..30128ac 100644 --- a/core/src/ch/asynk/gdx/boardgame/Positionable.java +++ b/core/src/ch/asynk/gdx/boardgame/Positionable.java @@ -6,5 +6,7 @@ public interface Positionable public float getY(); public float getWidth(); public float getHeight(); - public void setPosition(float x, float y, float w, float h); + public void centerOn(float cx, float cy); + public void translate(float dx, float dy); + public void setPosition(float x, float y); } diff --git a/core/src/ch/asynk/gdx/boardgame/Rotable.java b/core/src/ch/asynk/gdx/boardgame/Rotable.java new file mode 100644 index 0000000..789ce3d --- /dev/null +++ b/core/src/ch/asynk/gdx/boardgame/Rotable.java @@ -0,0 +1,6 @@ +package ch.asynk.gdx.boardgame; + +public interface Rotable +{ + public void setRotation(float rotation); +} diff --git a/core/src/ch/asynk/gdx/boardgame/Scalable.java b/core/src/ch/asynk/gdx/boardgame/Scalable.java index cf430ca..3cf63be 100644 --- a/core/src/ch/asynk/gdx/boardgame/Scalable.java +++ b/core/src/ch/asynk/gdx/boardgame/Scalable.java @@ -1,6 +1,6 @@ package ch.asynk.gdx.boardgame; -public interface Scalable extends Drawable +public interface Scalable { public void setScale(float scale); } -- cgit v1.1-2-g2b99