added Recti

This commit is contained in:
Dani The Skunk 2022-09-14 17:51:45 +02:00
parent 94245e7689
commit 89d9735203
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
package com.danitheskunk.skunkworks;
public final class Recti {
final Vec2i pos, size;
//constructors
public Recti(int x, int y, int width, int height) {
this(new Vec2i(x, y), new Vec2i(width, height));
}
public Recti(Vec2i pos, Vec2i size) {
this.pos = pos; this.size = size;
}
//getters
public Vec2i getPos() {
return pos;
}
public Vec2i getSize() {
return size;
}
public int getX() {
return pos.getX();
}
public int getY() {
return pos.getY();
}
public int getWidth() {
return size.getX();
}
public int getHeight() {
return size.getY();
}
}