9596979899100101
private static Segments rotation(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { return new Segments(p(x1, y1), p(x2, y2), p(x3, y3), p(x4, y4)); } private static Segment p(int x, int y) { return new Segment(x, y); }
121122123124125126127
public void fillRect(int x, int y, int width, int height) { int scaledX = (x - pitPanel.getX()) / scale; int scaledY = (y - pitPanel.getY()) / scale; pitMap.put(new Segment(scaledX, scaledY), color); }
123124125126127128129130131
public void fillRect(int x, int y, int width, int height) { int scaledX = x / scale; int scaledY = y / scale; if (scaledX >= 0 && scaledX < pitWidth && scaledY >=0 && scaledY < pitHeight) { pitMap.put(new Segment(scaledX, scaledY), color); asciiRepresentation[scaledY][scaledX] = colormap.getTypeFor(color).toAscii(); } }
127128129130131132133134135136137
StringBuffer buffer = new StringBuffer(); buffer.append("something containing ").append(System.getProperty("line.separator")); for (int y = 0; y < HEIGHT; y++) { for (int x = 0; x < WIDTH; x++) { if (segments.contains(new Segment(x, y))) { buffer.append(Hellbound.COLORMAP.getTypeFor(color).toString()); } else { buffer.append(GlyphType.PIT.toString()); } }
1213141516171819202122232425
import com.sirenian.hellbound.gui.RenderedPit; public class TheGlyphShouldFallToTheBottom extends HellboundOutcome { public void verifyAnyTimeIn(World world) { Segments expectedSegments = new Segments( new Segment(2, 11), new Segment(3, 11), new Segment(4, 11), new Segment(3, 12) ); Color expectedColor = Hellbound.COLORMAP.getColorFor(GlyphType.T); RenderedPit pit = getPit(world); Ensure.that(pit, contains(expectedSegments, expectedColor)); }
6263646566676869707172
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("something containing ").append(System.getProperty("line.separator")); for (int y = 0; y < Hellbound.HEIGHT; y++) { for (int x = 0; x < Hellbound.WIDTH; x++) { if (segments.contains(new Segment(x, y))) { buffer.append(Hellbound.COLORMAP.getTypeFor(color).toAscii()); } else { buffer.append(GlyphType.PIT.toAscii()); } }