public AssignmentTwoResults <T> TakeFirstN(int n) { if (n == Count) { return(this); } AssignmentTwoResults <T> to_return = new AssignmentTwoResults <T>(); for (int i = 0; i < n; ++i) { to_return.Add(this[i]); } return(to_return); }
public AssignmentTwoResultList <T> MaxTicksSubList(long max_ticks) { AssignmentTwoResultList <T> inner_list = new AssignmentTwoResultList <T>(name); foreach (AssignmentTwoResults <T> results in this) { AssignmentTwoResults <T> inner_results = new AssignmentTwoResults <T>(); long current_ticks = 0; foreach (AssignmentTwoResult <T> result in results) { current_ticks += result.TicksToReach; if (current_ticks > max_ticks) { break; } inner_results.Add(result); } inner_list.Add(inner_results); } return(inner_list); }