public void update(final GameContainer c, final int delta) { if (!active) { return; } final int centerX = c.getWidth() >> 1; final int centerY = c.getHeight() >> 1; final int offX = (centerX - origin.getDcX()) + dX; final int offY = (centerY - origin.getDcY()) + dY; final Avatar av = World.getAvatar(); if (av != null) { glueAvatarToOrigin(av); corridor.setCorridor(av); } Camera.getInstance().setViewport(-offX, -offY, c.getWidth(), c.getHeight()); Camera.getInstance().clearDirtyAreas(); if (legacyRendering) { Camera.getInstance().markEverythingDirty(); } synchronized (display) { for (final Rectangle rect : removedAreaList) { Camera.getInstance().markAreaDirty(rect); } synchronized (GameMap.LIGHT_LOCK) { while (true) { final MapInteractionEvent event = eventQueue.poll(); if (event == null) { break; } for (int i = display.size() - 1; i >= 0; i--) { if (display.get(i).processEvent(c, delta, event)) { break; } } } // update the items for (int i = 0, displaySize = display.size(); i < displaySize; i++) { display.get(i).update(c, delta); } } } if (fadeOutColor.getAlpha() > 0) { fadeOutColor.a = AnimationUtility.approach(fadeOutColor.getAlpha(), 0, 0, 255, delta) / 255.f; } }
/** 입장 가능한 방 을 가져온다 */ public int getRoomNum() { int room = 5; if (_roomlist1.size() <= 0 && _step < 1) { room = 0; } else if (_roomlist1.size() <= 8 && _step < 1) { room = 1; } else if (_roomlist2.size() <= 8 && _step < 2) { room = 2; } else if (_roomlist3.size() <= 8 && _step < 3) { room = 3; } else if (_roomlist4.size() <= 8 && _step < 4) { room = 4; } return room; }
public double findShortestStrut() { double minLength = Double.MAX_VALUE; for (int i = 0; i < struts.size(); i++) { minLength = Math.min(minLength, struts.get(i).getSqLength()); } return Math.sqrt(minLength); }
public WB_FrameNode getNeighbor(final int index) { if ((index < 0) || (index >= struts.size())) { throw new IllegalArgumentException("Index outside of strut range."); } if (struts.get(index).start() == this) { return struts.get(index).end(); } return struts.get(index).start(); }
public ArrayList<WB_FrameNode> getNeighbors() { final ArrayList<WB_FrameNode> result = new ArrayList<WB_FrameNode>(); for (int i = 0; i < struts.size(); i++) { if (struts.get(i).start() == this) { result.add(struts.get(i).end()); } else { result.add(struts.get(i).start()); } } return result; }
public boolean addStrut(final WB_FrameStrut strut) { if ((strut.start() != this) && (strut.end() != this)) { return false; } for (int i = 0; i < struts.size(); i++) { if ((struts.get(i).start() == strut.start()) && (struts.get(i).end() == strut.end())) { return false; } } struts.add(strut); return true; }
/** * Implementation of the core rendering function that just renders the map to the assigned graphic * context. * * @param g the graphics context used for the render operation */ private void renderImpl(final Graphics g) { final Camera camera = Camera.getInstance(); g.pushTransform(); g.translate(-camera.getViewportOffsetX(), -camera.getViewportOffsetY()); Camera.getInstance().clearDirtyAreas(g); synchronized (display) { synchronized (GameMap.LIGHT_LOCK) { // draw all items for (int i = 0, displaySize = display.size(); i < displaySize; i++) { display.get(i).draw(g); } } } g.popTransform(); }
public double findSmallestSpanAroundStrut(final int i) { final int n = struts.size(); if ((i < 0) || (i >= n)) { throw new IllegalArgumentException("Index beyond strut range."); } final ArrayList<WB_FrameNode> nnodes = getNeighbors(); if (n == 1) { return 2 * Math.PI; } else if (n == 2) { final WB_Vector u = nnodes.get(0).subToVector(this); final WB_Vector w = nnodes.get(1).subToVector(this); u._normalizeSelf(); w._normalizeSelf(); final double udw = WB_Math.clamp(u.dot(w), -1, 1); if (udw < WB_Epsilon.EPSILON - 1) { return Math.PI; } else { return Math.acos(udw); } } else { double minAngle = Double.MAX_VALUE; final WB_Vector u = nnodes.get(i).subToVector(this); u._normalizeSelf(); for (int j = 0; j < n; j++) { if (i != j) { final WB_Vector w = nnodes.get(j).subToVector(this); w._normalizeSelf(); final double a = Math.acos(u.dot(w)); minAngle = WB_Math.min(minAngle, a); } } return minAngle; } }
private void insertSorted(final DisplayItem item) { int currentStart = 0; int currentEnd = display.size() - 1; int middle; DisplayItem foundItem; int compareResult; while (currentStart <= currentEnd) { middle = currentStart + ((currentEnd - currentStart) >> 1); foundItem = display.get(middle); compareResult = displayListComperator.compare(foundItem, item); if (compareResult < 0) { currentStart = middle + 1; } else if (compareResult > 0) { currentEnd = middle - 1; } else { display.add(middle, item); return; } } display.add(currentStart, item); }
public int GetAttackClanListSize() { return _attackClanList.size(); }
public String[] GetAttackClanList() { return _attackClanList.toArray(new String[_attackClanList.size()]); }
public void removeStrut(final int index) { if ((index < 0) || (index >= struts.size())) { throw new IllegalArgumentException("Index outside of strut range."); } struts.remove(index); }
public WB_FrameStrut getStrut(final int index) { if ((index < 0) || (index >= struts.size())) { throw new IllegalArgumentException("Index outside of strut range."); } return struts.get(index); }
public int getOrder() { return struts.size(); }
private void tel4roomOut() { for (int i = 0; i > _roomlist1.size(); i++) { L1PcInstance pc = _roomlist1.get(i); // 방 아닌곳 좌표 잡아서 마을로텔 시키자 } }
/** 레어에 진입한 유저 수를 가져온다 */ public int countLairUser() { return _antalist.size(); }