Exemplo n.º 1
0
 /// <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)
     });
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public ShipPart(IBaseShip baseShip, IMapLocation location)
 {
     _baseShip = baseShip;
     _location = location;
     _status   = PartStatus.Intact;
 }
Exemplo n.º 4
0
 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)));
 }
Exemplo n.º 5
0
 /// <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;
 }