public void SetShip(int x, int y, ShipName name) { if (x >= 0 && x < 10 && y >= 0 && y < 10 && name.Equals(ShipName.Ship1)) { pole[x, y] = new Ship1(); } }
public void UpdateSpecialAttacksLeft() { if (ShipName.Equals("Scanner") || ShipName.Equals("Defender")) { SpecialAttacksLeft = 2; } else if (ShipName.Equals("Submarine") || ShipName.Equals("Cruiser")) { SpecialAttacksLeft = 0; FirstHit = true; } }
/// <summary> /// Returns true if BookingSummary instances are equal /// </summary> /// <param name="other">Instance of BookingSummary to be compared</param> /// <returns>Boolean</returns> public bool Equals(BookingSummary other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( ShipId == other.ShipId || ShipId != null && ShipId.Equals(other.ShipId) ) && ( ShipName == other.ShipName || ShipName != null && ShipName.Equals(other.ShipName) ) && ( BookingDate == other.BookingDate || BookingDate != null && BookingDate.Equals(other.BookingDate) ) && ( Price == other.Price || Price != null && Price.Equals(other.Price) )); }