/// <summary> /// Returns a new connection save data instance for this connection. /// </summary> /// <returns> /// A new connection save data instance. /// </returns> public ConnectionSaveData Save() { return(new ConnectionSaveData() { Location1 = Location1.Location !.ID, Location2 = Location2.Location !.ID, Index1 = Location1.Location.MapLocations.IndexOf(Location1), Index2 = Location2.Location.MapLocations.IndexOf(Location2) });
private void AddNewLocationToUi(IMapLocation mapLocationm, PartStatus?partStatus) { if (partStatus.HasValue) { if (partStatus == PartStatus.Intact) { _userInterface.MarkShipLocationOnMap(mapLocationm.X, mapLocationm.Y); } else { _userInterface.MarkHitLocationOnMap(mapLocationm.X, mapLocationm.Y); } } else { _userInterface.MarkMissLocationOnMap(mapLocationm.X, mapLocationm.Y); } }
public ShipPart(IBaseShip baseShip, IMapLocation location) { _baseShip = baseShip; _location = location; _status = PartStatus.Intact; }
private IShipPart CollisionDetection(IMapLocation location) { return(_enemyFleet.Select(x => new List <IShipPart>(x as BaseShip)) .FirstOrDefault(x => x.Any(y => y.Location.Equals(location)))? .FirstOrDefault(x => x.Location.Equals(location))); }
/// <summary> /// Constructor /// </summary> /// <param name="location1"> /// The first location to connect. /// </param> /// <param name="location2"> /// The second location to connect. /// </param> public Connection(IMapLocation location1, IMapLocation location2) { Location1 = location1; Location2 = location2; }