コード例 #1
0
 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");
     }
 }
コード例 #2
0
        //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);
        }
コード例 #3
0
        public override bool Equals(object obj)
        {
            bool isEqual;

            Slip temp = (Slip)obj;

            if (SlipId == temp.SlipId)
            {
                isEqual = true;
            }
            else
            {
                isEqual = false;
            }

            return(isEqual);
        }
コード例 #4
0
 public void RemoveBoatFromSlip(Slip aSlip)
 {
     aSlip.AnotherBoat = null;
 }