Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Gets the next two hits from the queue.
- */
- List<Hit> hits = player.getHitQueue();
- Hit first = null;
- if(hits.size() > 0) {
- for(int i = 0; i < hits.size(); i++) {
- Hit hit = hits.get(i);
- if(hit.getDelay() < 1) {
- first = hit;
- hits.remove(hit);
- break;
- }
- }
- }
- if (first != null) {
- player.setPrimaryHit(first);
- player.getUpdateFlags().flag(UpdateFlag.HIT);
- }
- Hit second = null;
- if(hits.size() > 0) {
- for(int i = 0; i < hits.size(); i++) {
- Hit hit = hits.get(i);
- if(hit.getDelay() < 1) {
- second = hit;
- hits.remove(hit);
- break;
- }
- }
- }
- if (second != null) {
- player.setSecondaryHit(second);
- player.getUpdateFlags().flag(UpdateFlag.HIT_2);
- }
- if(hits.size() > 0) {//tells us we still have more hits
- Iterator<Hit> hitIt = hits.iterator();
- while(hitIt.hasNext()) {
- Hit hit = hitIt.next();
- if(hit.getDelay() > 0) {
- hit.setDelay(hit.getDelay() - 1);
- }
- if(hit.getHitPriority() == HitPriority.LOW_PRIORITY) {
- hitIt.remove();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement