Mercurial > hg > ristipolku
diff game/Piece.java @ 27:26adc2827983
More work on the internals.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 01 Feb 2011 20:38:19 +0200 |
parents | 3d4cc47df31a |
children | 60a4579a79df |
line wrap: on
line diff
--- a/game/Piece.java Tue Feb 01 19:18:25 2011 +0200 +++ b/game/Piece.java Tue Feb 01 20:38:19 2011 +0200 @@ -122,6 +122,11 @@ active[index] = true; activeChanged = true; } + + public PieceType getType() + { + return type; + } public void animate(float time) { @@ -192,7 +197,6 @@ g.draw(new RoundRectangle2D.Float(x - offs1, y - offs1, dim + offs2, dim + offs2, dim / 10, dim / 10)); } - g.setPaint(Color.black); g.setStroke(new BasicStroke(6.0f)); // CubicCurve2D c = new CubicCurve2D.Float(); QuadCurve2D c = new QuadCurve2D.Float(); @@ -201,6 +205,9 @@ if (!drawn[i]) { Point2D start, cp1, cp2, end; + + boolean act = active[i] || active[connections[i]]; + g.setPaint(act ? Color.white : Color.black); start = getPointCoords(x, y, dim, i); end = getPointCoords(x, y, dim, connections[i]);