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/gamecore/util/math/constraints/vect/proxy/VectNumAdapter.java

57 lines
943 B

package mightypork.gamecore.util.math.constraints.vect.proxy;
import mightypork.gamecore.util.math.constraints.num.Num;
import mightypork.gamecore.util.math.constraints.num.proxy.NumBound;
import mightypork.gamecore.util.math.constraints.vect.Vect;
/**
* Coord view composed of given {@link NumBound}s, using their current values.
*
* @author Ondřej Hruška (MightyPork)
*/
public class VectNumAdapter extends Vect {
private final Num constrX;
private final Num constrY;
private final Num constrZ;
public VectNumAdapter(Num x, Num y, Num z)
{
this.constrX = x;
this.constrY = y;
this.constrZ = z;
}
public VectNumAdapter(Num x, Num y)
{
this.constrX = x;
this.constrY = y;
this.constrZ = Num.ZERO;
}
@Override
public double x()
{
return constrX.value();
}
@Override
public double y()
{
return constrY.value();
}
@Override
public double z()
{
return constrZ.value();
}
}