public void taskUpdate() { RotationJob job = tasks.FirstOrDefault(j => j.done == false); if (job == null) { complete(); } }
public static void buildRotationList() { LoLLauncher.RegionInfo.buildAll(); rotationList.Clear(); List <rotationJobSave> _TRotList = Storage.DeSerializeObject <List <rotationJobSave> >("rotations.xml"); List <SmurfData> _TsmurfList = Storage.DeSerializeObject <List <SmurfData> >("smurfs.xml"); List <GroupData> _groupList = Storage.DeSerializeObject <List <GroupData> >("groups.xml"); Rotation tRot; foreach (rotationJobSave rot in _TRotList) { if (rot.queuePos != "" && rot.queuePos != null) { if (rot.type == "wait") { tRot = new Rotation(); tRot.initRot(); tRot.type = rot.type; tRot.waitTime = rot.waittime; tRot.pcSleep = rot.pcsleep; RotationJob task; if (rot.pcsleep) { task = new RotationJob(ref tRot, rot.waittime, "Sleep Waiting Task", true); } else { task = new RotationJob(ref tRot, rot.waittime * 60, "Waiting Task"); } tRot.addTask(task); sessionManager.addRotation(ref tRot); addRotation(tRot); } if (rot.type == "task") { tRot = new Rotation(); tRot.initRot(); tRot.type = rot.type; tRot.waitTime = rot.waittime; tRot.endType = rot.endType; RotationJob task; foreach (var smrf in rot.smurfIds) { if (_TsmurfList.Exists(i => i.id == smrf)) { SmurfData foundSmurf = _TsmurfList.First(i => i.id == smrf); if (rot.endType == "timer") { task = new RotationJob(ref tRot, foundSmurf, foundSmurf.username, rot.waittime); } else { task = new RotationJob(ref tRot, foundSmurf, foundSmurf.username); } tRot.addTask(task); } else { throw new Exception("Smurf with id " + smrf + " can't be found on smurf list."); } } sessionManager.addRotation(ref tRot); addRotation(tRot); } } } }
public void addTask(RotationJob _task) { tasks.Add(_task); }