Revision 560
added iterator code to replace looping (should be thread safe)
trunk/code/projects/colonet/client/Colonet.java | ||
---|---|---|
960 | 960 |
// Draw Identifiers and battery levels |
961 | 961 |
if (robotIcons != null) { |
962 | 962 |
bufferedGraphics.setStroke(new BasicStroke(2)); |
963 |
for (int i = 0; i < robotIcons.size(); i++) { |
|
964 |
RobotIcon r = robotIcons.get(i); |
|
963 |
Iterator <Map.Entry<Integer,RobotIcon>> it = robotIcons.entrySet().iterator(); |
|
964 |
while (it.hasNext()) { |
|
965 |
RobotIcon r = it.next().getValue(); |
|
965 | 966 |
bufferedGraphics.setColor(r.color); |
966 | 967 |
// Identifier circle |
967 | 968 |
int px = (int) (x + r.x * scale); |
Also available in: Unified diff