コード例 #1
0
ファイル: NewsBox.cs プロジェクト: tehknox/tap-desktop
 //removes a news from the news box
 public void removeNews(News news)
 {
     this.News.Remove(news);
     this.HasUnreadNews = this.News.Exists(n => n.IsUnRead);
 }
コード例 #2
0
ファイル: NewsBox.cs プロジェクト: tehknox/tap-desktop
 //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; }));
 }
コード例 #3
0
ファイル: NewsBox.cs プロジェクト: tehknox/tap-desktop
 //adds a news to the news box
 public void addNews(News news)
 {
     this.HasUnreadNews = true;
     this.News.Add(news);
 }
コード例 #4
0
 public NewsMVVM(News news)
 {
     this.News = news;
     this.IsRead = news.IsRead;
     this.IsUnRead = !news.IsRead;
 }
コード例 #5
0
ファイル: AirlineHelpers.cs プロジェクト: tehknox/tap-desktop
        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);
            }
        }
コード例 #6
0
ファイル: AirlineHelpers.cs プロジェクト: tehknox/tap-desktop
 //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);
 }