/// <summary> /// Gets items of the specified type. Sorts by name or start time based on the supplied flag. /// </summary> public static List <GatheringItem> GetItemsOfType(Enums.NodeType type, bool sortByStartTime) { var subset = GatheringRepository.GatheringItems .Where(x => x.NodeType == type); return(sortByStartTime ? subset.OrderBy(x => x.NodeAvailability.StartTime).ToList() : subset.OrderBy(x => x.Name).ToList()); }
/// <summary> /// Builds a gathering item with the specified details. /// </summary> private static GatheringItem Build( string name, string zone, float xAxis, float yAxis, uint?start, uint?end, bool amAndPm, Enums.NodeType nodeType, Enums.Aethersand sandType, Enums.ClusterType clusterType, Enums.Gatherer gatherer, Enums.ScripType scripType) => new GatheringItem { Name = name, Zone = zone, Location = new Location(xAxis, yAxis), NodeAvailability = start == null && end == null ? new NodeAvailability() : new NodeAvailability(start.Value, end.Value, amAndPm), NodeType = nodeType, ReducesTo = sandType, ClusterType = clusterType, Gatherer = gatherer, ScripType = scripType };