diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-08 15:20:00 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-08 15:20:00 +0200 |
commit | 247f2e0ccf2563d5d67081608b870bd08a24c93c (patch) | |
tree | db5ad2bbc020528acabf5c150c20ab88aa26d363 /core | |
parent | 13fbbbc4ad77a9fb8f5951502e7ed2efa05278f8 (diff) | |
download | gdx-boardgame-247f2e0ccf2563d5d67081608b870bd08a24c93c.zip gdx-boardgame-247f2e0ccf2563d5d67081608b870bd08a24c93c.tar.gz |
Drawable,Paddable,Posisionable,Scalable : split interfaces
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Drawable.java | 9 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Paddable.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Positionable.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Scalable.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Element.java | 6 |
5 files changed, 31 insertions, 11 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Drawable.java b/core/src/ch/asynk/gdx/boardgame/Drawable.java index 618d6a2..8c53e62 100644 --- a/core/src/ch/asynk/gdx/boardgame/Drawable.java +++ b/core/src/ch/asynk/gdx/boardgame/Drawable.java @@ -5,15 +5,6 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public interface Drawable { - public float getX(); - public float getY(); - public float getWidth(); - public float getHeight(); - public float getInnerX(); - public float getInnerY(); - public float getInnerWidth(); - public float getInnerHeight(); public void draw(Batch batch); default public void drawDebug(ShapeRenderer debugShapes) { } - public void setPosition(float x, float y, float w, float h); } diff --git a/core/src/ch/asynk/gdx/boardgame/Paddable.java b/core/src/ch/asynk/gdx/boardgame/Paddable.java new file mode 100644 index 0000000..344c4ff --- /dev/null +++ b/core/src/ch/asynk/gdx/boardgame/Paddable.java @@ -0,0 +1,11 @@ +package ch.asynk.gdx.boardgame; + +public interface Paddable +{ + public float getInnerX(); + public float getInnerY(); + public float getInnerWidth(); + public float getInnerHeight(); + public void setPadding(float padding); +} + diff --git a/core/src/ch/asynk/gdx/boardgame/Positionable.java b/core/src/ch/asynk/gdx/boardgame/Positionable.java new file mode 100644 index 0000000..d16f5ce --- /dev/null +++ b/core/src/ch/asynk/gdx/boardgame/Positionable.java @@ -0,0 +1,10 @@ +package ch.asynk.gdx.boardgame; + +public interface Positionable +{ + public float getX(); + public float getY(); + public float getWidth(); + public float getHeight(); + public void setPosition(float x, float y, float w, float h); +} diff --git a/core/src/ch/asynk/gdx/boardgame/Scalable.java b/core/src/ch/asynk/gdx/boardgame/Scalable.java new file mode 100644 index 0000000..cf430ca --- /dev/null +++ b/core/src/ch/asynk/gdx/boardgame/Scalable.java @@ -0,0 +1,6 @@ +package ch.asynk.gdx.boardgame; + +public interface Scalable extends Drawable +{ + public void setScale(float scale); +} diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Element.java b/core/src/ch/asynk/gdx/boardgame/ui/Element.java index 25f38eb..5f5fcb3 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Element.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Element.java @@ -4,9 +4,11 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Rectangle; import ch.asynk.gdx.boardgame.Drawable; +import ch.asynk.gdx.boardgame.Paddable; +import ch.asynk.gdx.boardgame.Positionable; import ch.asynk.gdx.boardgame.Touchable; -public abstract class Element implements Drawable, Touchable +public abstract class Element implements Drawable, Paddable, Positionable, Touchable { public boolean blocked; public boolean visible; @@ -71,7 +73,7 @@ public abstract class Element implements Drawable, Touchable this.tainted = true; } - public void setPadding(float padding) + @Override public void setPadding(float padding) { this.padding = padding; this.tainted = true; |