mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Legger til to nye java grensesnitt
Legger til IDrawableObject som beskriver et tegnbart objekt Legger til IDrawableGame som beskriver et tegnbart spill
This commit is contained in:
parent
3e5626e955
commit
07e2c8e5a4
16
src/main/java/inf112/skeleton/app/IDrawableGame.java
Normal file
16
src/main/java/inf112/skeleton/app/IDrawableGame.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package inf112.skeleton.app;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface describes a game drawable using libgdx
|
||||||
|
*/
|
||||||
|
public interface IDrawableGame {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a list of objects which are to be rendered
|
||||||
|
* @return A list of drawable objects in the order they are to be drawn
|
||||||
|
*/
|
||||||
|
List<IDrawableObject> objectsToRender();
|
||||||
|
|
||||||
|
}
|
66
src/main/java/inf112/skeleton/app/IDrawableObject.java
Normal file
66
src/main/java/inf112/skeleton/app/IDrawableObject.java
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
package inf112.skeleton.app;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface describes an object drawable using libgdx
|
||||||
|
*/
|
||||||
|
public interface IDrawableObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the texture to use for drawing the object
|
||||||
|
* @return The texture of the object
|
||||||
|
*/
|
||||||
|
Texture getTexture();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the x position the object should be drawn on
|
||||||
|
*
|
||||||
|
* The x position should be in terms of the actual pixel position on the rendered game, not the position according
|
||||||
|
* to the game tile. E.g. (128,64) not (2,1).
|
||||||
|
*
|
||||||
|
* @return An x position libgdx
|
||||||
|
*/
|
||||||
|
int getXPosition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the y position the object should be drawn on
|
||||||
|
*
|
||||||
|
* The y position should be in terms of the actual pixel position on the rendered game, not the position according
|
||||||
|
* to the game tile. E.g. (128,64) not (2,1).
|
||||||
|
*
|
||||||
|
* @return An x position libgdx
|
||||||
|
*/
|
||||||
|
int getYPosition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the width of the object
|
||||||
|
* @return A positive integer
|
||||||
|
*/
|
||||||
|
int getWidth();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the height of the object
|
||||||
|
* @return A positive integer
|
||||||
|
*/
|
||||||
|
int getHeight();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the number of degrees to rotate the texture counterclockwise when rendering
|
||||||
|
* @return An integer
|
||||||
|
*/
|
||||||
|
int getRotation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to flip the texture on the x-axis when rendering
|
||||||
|
* @return True if the texture is to be flipped. False otherwise
|
||||||
|
*/
|
||||||
|
boolean flipX();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to flip the texture on the y-axis when rendering
|
||||||
|
* @return True if the texture is to be flipped. False otherwise
|
||||||
|
*/
|
||||||
|
boolean flipY();
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user