public static Toil MoveCurrentTargetIntoQueue(TargetIndex ind) { Toil toil = new Toil(); toil.initAction = delegate() { Job curJob = toil.actor.CurJob; LocalTargetInfo target = curJob.GetTarget(ind); if (target.IsValid) { List <LocalTargetInfo> targetQueue = curJob.GetTargetQueue(ind); if (targetQueue == null) { curJob.AddQueuedTarget(ind, target); } else { targetQueue.Insert(0, target); } curJob.SetTarget(ind, null); } }; return(toil); }