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/test/TestTiled.java

44 lines
953 B

package mightypork.test;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.num.mutable.NumVar;
import mightypork.util.constraints.rect.Rect;
public class TestTiled {
public static void main(String[] args)
{
// {
// RectVar area = Rect.makeVar(0, 0, 100, 100);
//
// TiledRect tiled = area.tiles(5, 5).oneBased();
//
// System.out.println(tiled.span(1, 1, 1, 1));
// System.out.println(tiled.span(1, 1, 3, 1));
// }
// {
// RectVar area = Rect.makeVar(0, 0, 100, 100);
// TiledRect tiled = area.columns(4);
//
// System.out.println(tiled.column(2));
//
//
//
// }
//
{
Rect abox;
final Rect b = Rect.make(100, 100, 100, 10);
final NumVar pos = Num.makeVar(1);
abox = b.leftEdge().growRight(b.height());
abox = abox.move(b.width().sub(b.height()).mul(pos), Num.ZERO);
//abox = abox.shrink(b.height().perc(10));
System.out.println(abox);
}
}
}