Beispiel #1
0
 public void Finish(ResearchNode node)
 {
     foreach (var n in node.MissingPrerequisitesInc())
     {
         _queue.Remove(n);
         Find.ResearchManager.FinishProject(n.Research);
     }
 }
Beispiel #2
0
 public void Prepend(ResearchNode node)
 {
     if (CantResearch(node))
     {
         return;
     }
     UnsafeConcatFront(node.MissingPrerequisitesInc());
     UpdateCurrentResearch();
 }
Beispiel #3
0
        public void Insert(ResearchNode node, int pos)
        {
            if (CantResearch(node))
            {
                return;
            }
            pos = Math.Max(0, Math.Min(Count(), pos));
            var idx = _queue.IndexOf(node);

            if (idx == pos)
            {
                return;
            }
            if (idx != -1)
            {
                DoMove(node, idx, pos);
            }
            else
            {
                UnsafeInsert(node.MissingPrerequisitesInc(), pos);
            }
            UpdateCurrentResearch();
        }
Beispiel #4
0
 private void UnsafeAppend(ResearchNode node)
 {
     UnsafeConcat(node.MissingPrerequisitesInc());
     UpdateCurrentResearch();
 }