Пример #1
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);
         }
     }
 }
Пример #2
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);
         }
     }
 }