Mercurial > hg > ristipolku
diff game/Piece.java @ 134:4c0dec72e2f0
Whitespace cosmetic cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 24 Nov 2011 21:51:54 +0200 |
parents | 41c6cca69d60 |
children | 9eb791e2fa17 |
line wrap: on
line diff
--- a/game/Piece.java Thu Nov 24 21:50:41 2011 +0200 +++ b/game/Piece.java Thu Nov 24 21:51:54 2011 +0200 @@ -13,7 +13,7 @@ public class Piece { public enum RotateDir { LEFT, RIGHT } - + static final int numConnections = 8; static final float maxTime = 50.0f; @@ -47,7 +47,7 @@ typeChanged = false; typeActive = false; - + throbTime = 0; lerpType = new Interpolate(1.0f, 0.0f, maxTime); @@ -83,7 +83,7 @@ { typeChanged = true; } - + public void setType(PieceType ptype) { // typeChanged = (prevType != ptype) && (ptype == PieceType.LOCKED); @@ -116,7 +116,7 @@ if (point < 0) point = 8 + point; return point; } - + public int getMatchingPoint(int point) { switch (point) @@ -152,10 +152,10 @@ { return (float) ((rotation * Math.PI) / 2.0f); } - + public void rotate(RotateDir dir) { - // Only normal + // Only normal if (type != PieceType.LOCKED && type != PieceType.ACTIVE) return; @@ -168,7 +168,7 @@ { float ox = 0, oy = 0; float step = dim / 10; - + switch (index) { // Normal line starting and ending points case 0: ox = 3.0f; oy = 0.4f; break; @@ -200,7 +200,7 @@ return new Point2D.Float(x + ox * step, y + oy * step); } - + public PieceType getType() { return type; @@ -240,7 +240,7 @@ typeActive = true; typeChanged = false; } - + if (typeActive) { float t = (time - typeTime) * 2.0f; @@ -253,11 +253,11 @@ typeActive = false; } } - + if (stateChanged) { } - + throbTime = (time % 100) / 100.0f; } @@ -340,7 +340,7 @@ drawn[i] = true; drawn[connections[i]] = true; } - + } // !PieceType.START g.setTransform(save);