public void AddSlipToCustomer(Slip aslip) { if (slipCounter < MAX_SLIPS) { slips[slipCounter] = aslip; ++slipCounter; } else { Console.WriteLine("You are not supposed to have more than 20 slips"); } }
//public string GetInfo() //{ // string info = string.Format("The registration number is {0}, boat length, is {1}, manufacturer is {2}, year of manufactoring {3}, the owner {4}", RegistrationNumber, boatLength, boatManufacturer, yearOfManufectoring, ownership.CustomerName); // return info; //} public bool AssignBoatToSlip(Slip aSlip) { bool assignABoat = false; if (aSlip.SlipLength >= boatLength) { assignABoat = aSlip.LeasesSlip(ownership); if (assignABoat) { aSlip.AnotherBoat = this; } } return(assignABoat); }
public override bool Equals(object obj) { bool isEqual; Slip temp = (Slip)obj; if (SlipId == temp.SlipId) { isEqual = true; } else { isEqual = false; } return(isEqual); }
public void RemoveBoatFromSlip(Slip aSlip) { aSlip.AnotherBoat = null; }