Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void drawItems(byte[][] map, Location l, double rad, Role role) {
- // items là một synchronizedList nên ta sẽ đưa nó vào khối lệnh synchronized khi thực hiện iterate
- synchronized (items) {
- Iterator<MapItem> i = items.iterator();
- while (i.hasNext()) {
- MapItem item = i.next();
- if (item.isExpired()) {
- i.remove();
- continue;
- }
- if (item.getRole() == role || item.getRole() == null) {
- MapPosition mp = MapPosition.calculatedPos(l, item.getLocation(), rad);
- placeIcon(map, item.getIcon(), mp.x, mp.y);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment