public Player() { skill[0] = new Skill(this, "1", 1000, 1000,0); skill[1] = new Skill(this, "2", 2000, 1000,1); skill[2] = new Skill(this, "3", 3000, 1000,2); skill[3] = new Skill(this, "4", 8000, 1000,3); skill[4] = new Skill(this, "5", 10000, 1000,4); }
public void enqueue(Skill skill) { if (firstInQueue==null) { firstInQueue = skill; } else { if (firstInQueue.getPriority() < skill.getPriority()) { skill.setNextSkill(firstInQueue); firstInQueue = skill; } else { firstInQueue.enqueue(skill); } } }
public void enqueue(Skill skill) { if (nextSkill == null) { nextSkill = skill; } else { if (nextSkill.getPriority() < skill.getPriority()) { skill.setNextSkill(nextSkill); nextSkill = skill; } else { nextSkill.enqueue(skill); } } }
public void setNextSkill(Skill skill) { nextSkill = skill; }
public void dequeue() { Skill skill = firstInQueue.getNextSkill(); firstInQueue.setNextSkill(null); firstInQueue = skill; }