// Path: game-graphics/src/main/java/com/game/graphics/math/Dimension.java
// public class Dimension {
// 
// 	public float x1;
// 	public float y1;
// 	public float x2;
// 	public float y2;
// 
// 	public Dimension() {
// 		this (0, 0, 0, 0);
// 	}
// 
// 	public Dimension(float x1, float y1, float x2, float y2) {
// 		this.x1 = x1;
// 		this.y1 = y1;
// 		this.x2 = x2;
// 		this.y2 = y2;
// 	}
// }


import com.game.graphics.math.Dimension;
package com.game.graphics.renderer;


public class SpriteMap {

	public final Sprite sprite;
	public final int elementWidth;
	public final int elementHeight;

	// The amount of elements stored in this sprite
	public final int width;
	public final int height;

	public SpriteMap(Sprite sprite, int elementWidth, int elementHeight) {
		this.sprite = sprite;
		this.elementWidth = elementWidth;
		this.elementHeight = elementHeight;

		if (sprite.originalWidth % elementWidth != 0 || sprite.originalHeight % elementHeight != 0) {
			// fatal error
			throw new RuntimeException("Attempted to load sprite map, but the sprites dimensions aren't multiples of the element dimensions.");
		}

		width = sprite.originalWidth / elementWidth;
		height = sprite.originalHeight / elementHeight;
	}

// Path: game-graphics/src/main/java/com/game/graphics/math/Dimension.java
// public class Dimension {
// 
// 	public float x1;
// 	public float y1;
// 	public float x2;
// 	public float y2;
// 
// 	public Dimension() {
// 		this (0, 0, 0, 0);
// 	}
// 
// 	public Dimension(float x1, float y1, float x2, float y2) {
// 		this.x1 = x1;
// 		this.y1 = y1;
// 		this.x2 = x2;
// 		this.y2 = y2;
// 	}
// }


// Path: game-graphics/src/main/java/com/game/graphics/renderer/SpriteMap.java
import com.game.graphics.math.Dimension;

package com.game.graphics.renderer;


public class SpriteMap {

	public final Sprite sprite;
	public final int elementWidth;
	public final int elementHeight;

	// The amount of elements stored in this sprite
	public final int width;
	public final int height;

	public SpriteMap(Sprite sprite, int elementWidth, int elementHeight) {
		this.sprite = sprite;
		this.elementWidth = elementWidth;
		this.elementHeight = elementHeight;

		if (sprite.originalWidth % elementWidth != 0 || sprite.originalHeight % elementHeight != 0) {
			// fatal error
			throw new RuntimeException("Attempted to load sprite map, but the sprites dimensions aren't multiples of the element dimensions.");
		}

		width = sprite.originalWidth / elementWidth;
		height = sprite.originalHeight / elementHeight;
	}

	public Dimension getSprite(int index) {