1
0
mirror of https://github.com/inf112-v20/Fiasko.git synced 2025-07-05 23:54:43 +02:00

Omstrukturerer litt mens det fortsatt er enkelt

Forbedrer tester
Bytter navn på noen metoder og variabler
Bytter noen tall til relevante konstanter
Stokker om på rekkefølgen i konstruksjonsmetodene til DrawableObject
This commit is contained in:
2020-02-05 05:14:35 +01:00
parent e4784246bf
commit 4eb5b42755
5 changed files with 54 additions and 43 deletions
src
main
java
inf112
test
java

@ -6,27 +6,28 @@ import inf112.fiasko.roborally.abstractions.GameTexture;
* This class represents an object that can be drawn using libgdx
*/
public class DrawableObject implements IDrawableObject {
private GameTexture texture;
private int xPos;
private int yPos;
private int width = 64;
private int height = 64;
private int rotation = 0;
private GameTexture texture;
private boolean flipX = false;
private boolean flipY = false;
/**
* Initializes a drawable object
* @param texture The texture to use for drawing the element
* @param xPos The pixel to start drawing on for the x axis
* @param yPos The pixel to start drawing on for the y axis
* @param texture The texture to use for drawing the element
* @param rotation The amount of degrees to rotate the element counterclockwise
* @param width The width of the element
* @param height The height of the element
* @param rotation The amount of degrees to rotate the element counterclockwise
* @param flipX Whether to flip/mirror the element over the x axis
* @param flipY Whether to flip/mirror the element over the y axis
*/
public DrawableObject(int xPos, int yPos, GameTexture texture, int rotation, int width, int height, boolean flipX, boolean flipY) {
public DrawableObject(GameTexture texture, int xPos, int yPos, int width, int height, int rotation, boolean flipX,
boolean flipY) {
this.xPos = xPos;
this.yPos = yPos;
this.rotation = rotation;
@ -39,11 +40,11 @@ public class DrawableObject implements IDrawableObject {
/**
* Initializes a new drawable object
* @param texture The texture to use for drawing the element
* @param xPos The pixel to start drawing on for the x axis
* @param yPos The pixel to start drawing on for the y axis
* @param texture The texture to use for drawing the element
*/
public DrawableObject(int xPos, int yPos, GameTexture texture) {
public DrawableObject(GameTexture texture, int xPos, int yPos) {
this.xPos = xPos;
this.yPos = yPos;
this.texture = texture;