//removes a news from the news box public void removeNews(News news) { this.News.Remove(news); this.HasUnreadNews = this.News.Exists(n => n.IsUnRead); }
//returns all news for a specific type public List<News> getNews(News.NewsType type) { return this.News.FindAll((delegate(News n) { return n.Type == type; })); }
//adds a news to the news box public void addNews(News news) { this.HasUnreadNews = true; this.News.Add(news); }
public NewsMVVM(News news) { this.News = news; this.IsRead = news.IsRead; this.IsUnRead = !news.IsRead; }
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); }