Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/utils/math/rect/RectMutableImpl.java

55 lines
853 B

package mightypork.utils.math.rect;
import mightypork.utils.math.vect.Vect;
import mightypork.utils.math.vect.VectMutable;
import mightypork.utils.math.vect.VectView;
class RectMutableImpl extends RectMutable {
final VectMutable pos = VectMutable.zero();
final VectMutable size = VectMutable.zero();
/**
* Create at given origin, with given size.
*
* @param x
* @param y
* @param width
* @param height
*/
public RectMutableImpl(double x, double y, double width, double height) {
this.pos.setTo(x, y);
this.size.setTo(width, height);
}
@Override
public VectView origin()
{
return pos;
}
@Override
public VectView size()
{
return size;
}
@Override
public void setOrigin(Vect origin)
{
this.pos.setTo(origin);
}
@Override
public void setSize(Vect size)
{
this.size.setTo(size);
}
}