public static void ReceiveInsurancePayout(Airline airline, AirlineInsurance policy, InsuranceClaim claim) { if (claim.Damage > policy.Deductible) { claim.Damage -= (int)policy.Deductible; airline.Money -= policy.Deductible; policy.Deductible = 0; policy.InsuredAmount -= claim.Damage; airline.Money += claim.Damage; News news = new News(News.NewsType.Airline_News, GameObject.GetInstance().GameTime, "Insurance Claim Payout", "You have received an insurance payout in the amount of $" + claim.Damage.ToString() + ". This was for claim number " + claim.Index); } else if (claim.Damage < policy.Deductible) { policy.Deductible -= claim.Damage; //Warnings.AddWarning("Low Damage", "The damage incurred was less than your deductible, so you will not receive an insurance payout for this claim! \n Reference: " + claim.Index); } }
//for damage and claims involving an airliner and airport or airport facility public static void FileInsuranceClaim(Airline airline, FleetAirliner airliner, Airport airport, int damage) { InsuranceClaim claim = new InsuranceClaim(airline, airliner, airport, GameObject.GetInstance().GameTime, damage); airline.InsuranceClaims.Add(claim); News news = new News(News.NewsType.Airline_News, GameObject.GetInstance().GameTime, "Insurance Claim Filed", "You have filed an insurance claim. Reference: " + claim.Index); }