Mercurial > hg > ristipolku
comparison game/Piece.java @ 30:60a4579a79df dev-0_1
Moar work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 02 Feb 2011 22:45:53 +0200 |
parents | 26adc2827983 |
children | e480579cc460 |
comparison
equal
deleted
inserted
replaced
29:4a0f8dcdaa3f | 30:60a4579a79df |
---|---|
79 type = ptype; | 79 type = ptype; |
80 } | 80 } |
81 | 81 |
82 public int getConnection(int in) | 82 public int getConnection(int in) |
83 { | 83 { |
84 return connections[in]; | 84 return connections[(in + (currRotation * 2)) % 8]; |
85 } | 85 } |
86 | 86 |
87 public void rotate(boolean dir) | 87 public void rotate(boolean dir) |
88 { | 88 { |
89 // Only normal | 89 // Only normal |
118 } | 118 } |
119 | 119 |
120 public void setActiveConnection(int index) | 120 public void setActiveConnection(int index) |
121 { | 121 { |
122 active[index] = true; | 122 active[index] = true; |
123 active[connections[index]] = true; | |
123 activeChanged = true; | 124 activeChanged = true; |
124 } | 125 } |
125 | 126 |
126 public PieceType getType() | 127 public PieceType getType() |
127 { | 128 { |