2020-02-04 17:52:17 +01:00
|
|
|
package inf112.fiasko.roborally.objects;
|
|
|
|
|
2020-02-24 18:07:26 +01:00
|
|
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
2020-01-31 12:59:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2020-02-24 18:07:26 +01:00
|
|
|
TextureRegion getTexture();
|
2020-01-31 12:59:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
|
|
|
|
}
|