private static string _checkFor(string output, int hexValue, int parentId, int child1Id, int child2Id, JobGroup group, int gender) { int familyId = parentId | child1Id | child2Id; if (group.IsOnlySubsetOf(JobGroup.Renewal)) { // Remove first class, it's not supposed to be there... hexValue &= ~parentId; } if ((hexValue & familyId) == familyId) { string toAdd = Job.Get(familyId).Name + ", "; if (output.EndsWith(" Class, ")) { return(output + toAdd); } if (!output.Contains(" Class, ")) { if (_insertAfter(ref output, toAdd, "Novice, ", group)) { return(output); } if (_insertAfter(ref output, toAdd, "Female Only, ", group)) { return(output); } if (_insertAfter(ref output, toAdd, "Male Only, ", group)) { return(output); } return(_getUpper(group) + toAdd + output); } int lastIndex = output.LastIndexOf(" Class, ", StringComparison.Ordinal); return(output.Insert(lastIndex + " Class, ".Length, toAdd)); } if ((hexValue & child1Id) == child1Id && (hexValue & child2Id) == child2Id && group.IsBetween(JobGroup.PreRenewal, JobGroup.Renewal) && Job.Get(child1Id | child2Id) != null) { string toAdd = Job.Get(child1Id | child2Id).Name + ", "; if (output.EndsWith(" Class, ")) { return(output + toAdd.Replace("3rd ", "")); } if (!output.Contains(" Class, ")) { if (_insertAfter(ref output, toAdd, "Novice, ", group)) { return(output); } if (_insertAfter(ref output, toAdd, "Female Only, ", group)) { return(output); } if (_insertAfter(ref output, toAdd, "Male Only, ", group)) { return(output); } return(_getUpper(group) + toAdd + output); } toAdd = toAdd.Replace("3rd ", ""); int lastIndex = output.LastIndexOf(" Class, ", StringComparison.Ordinal); return(output.Insert(lastIndex + " Class, ".Length, toAdd)); } if ((hexValue & child1Id) == child1Id && (hexValue & child2Id) == child2Id) { return(output + Job.Get(child1Id, group).GetName(gender) + ", " + Job.Get(child2Id, group).GetName(gender) + ", "); } if ((hexValue & child1Id) == child1Id && (hexValue & parentId) == parentId) { return(output + Job.Get(parentId, group).GetName(gender) + ", " + Job.Get(child1Id, group).GetName(gender) + ", "); } if ((hexValue & child2Id) == child2Id && (hexValue & parentId) == parentId) { return(output + Job.Get(parentId, group).GetName(gender) + ", " + Job.Get(child2Id, group).GetName(gender) + ", "); } if ((hexValue & child1Id) == child1Id) { return(output + Job.Get(child1Id, group).GetName(gender) + ", "); } if ((hexValue & child2Id) == child2Id) { return(output + Job.Get(child2Id, group).GetName(gender) + ", "); } if ((hexValue & parentId) == parentId) { return(output + Job.Get(parentId, group).GetName(gender) + ", "); } return(output); }
public static Job Get(int id, JobGroup group) { Job job; if (_returnIf(id, group.Id, out job)) { return(job); } if (group.IsOnlySubsetOf(JobGroup.Baby)) { if (group.IsOnlySubsetOf(JobGroup.Baby3)) { if (_returnIf(id, JobGroup.Baby3.Id, out job)) { return(job); } } if (_returnIf(id, JobGroup.Baby2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Renewal)) { if (_returnIf(id, JobGroup.Normal3.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans3)) { if (_returnIf(id, JobGroup.Trans3.Id, out job)) { return(job); } } if (group.Is(JobGroup.TransM)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans2)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.IsBetween(JobGroup.PreRenewal, JobGroup.Renewal)) { if (_returnIf(id, JobGroup.Normal3.Id, out job)) { return(job); } } if (_returnIf(id, JobGroup.Normal2.Id, out job)) { return(job); } return(Get(id)); }
public static Job Get(long id, JobGroup group, int equipLevel = 0) { Job job; if (equipLevel >= 100) { group = JobGroup.Get(group.Id & ~JobGroup.PreRenewal.Id); } if (_returnIf(id, group.Id, out job)) { return(job); } if (group.IsOnlySubsetOf(JobGroup.Baby)) { if (group.IsOnlySubsetOf(JobGroup.Baby3)) { if (_returnIf(id, JobGroup.Baby3.Id, out job)) { return(job); } } if (_returnIf(id, JobGroup.Baby2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Renewal)) { if (_returnIf(id, JobGroup.Normal3.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans3)) { if (_returnIf(id, JobGroup.Trans3.Id, out job)) { return(job); } } if (group.Is(JobGroup.TransM)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans2)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.Is(JobGroup.Trans)) { if (_returnIf(id, JobGroup.Trans2.Id, out job)) { return(job); } } if (group.IsBetween(JobGroup.PreRenewal, JobGroup.Renewal)) { if (_returnIf(id, JobGroup.Normal3.Id, out job)) { return(job); } } if (_returnIf(id, JobGroup.Normal2.Id, out job)) { return(job); } return(Get(id)); }