Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 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);
         }
     }
 }
Exemplo n.º 4
0
 public void setNextSkill(Skill skill)
 {
     nextSkill = skill;
 }
Exemplo n.º 5
0
 public void dequeue()
 {
     Skill skill = firstInQueue.getNextSkill();
     firstInQueue.setNextSkill(null);
     firstInQueue = skill;
 }