/// <summary> /// Creates a new ShotList with Shot objects in both list1 and list2. /// </summary> /// <returns>A new ShotList object with the Coordinatess of both ShotList objects.</returns> public static ShotList operator +(ShotList list1, ShotList list2) { ShotList newList = new ShotList(list1); newList.Add(list2); return(newList); }
/// <summary> /// Generates a ShotList of Shot objects whose Coordinates are equal to the given Coordinates. /// </summary> /// <param name="coords">The Coordinates to get a ShotList for.</param> /// <returns>A ShotList of Shot objects whose Coordinates are equal to that given.</returns> public ShotList ShotsFromCoordinates(Coordinates coords) { ShotList newList = new ShotList(); foreach (var shot in allShots) { if (shot.Coordinates == coords) { newList.Add(shot); } } return(newList); }