Пример #1
0
 public static Profile New(String name, String email, FeedbackCommon.ProfileType type)
 {
     Profile p = new Profile();
     // This should only run when creating the profile so the ID doesn't change between runs
     p.FeedbackInfo = new FeedbackCommon.Profile
     {
         Name = name,
         EMail = email,
         HWID = Common.Utils.GetMac(),
         Type = type
     };
     p.FeedbackInfo.HttpPost(Settings.StatisticsURI);
     p.Name = name;
     p.EmailAddress = email;
     p.Save();
     return p;
 }
Пример #2
0
 public bool IsNextTier(Profile profile)
 {
     if (Cutscene) return false;
     if (IsAvailable(profile)) return false;
     var p = PreviousTier;
     while (p.Cutscene)
         p = p.PreviousTier;
     return p.IsAvailable(profile);
 }
Пример #3
0
 public bool IsUnlockable(Profile profile)
 {
     return IsNextTier(profile) && profile.GoldCoins >= Cost;
 }
Пример #4
0
 public bool IsAvailable(Profile profile)
 {
     if (Cutscene)
     {
         var p = Campaign.GetPreviousTier(this);
         return p == null ||
             (p.IsAvailable(profile) && p.IsCompleted(profile));
     }
     else
         return profile.AvailableTiers.Contains(Name);
 }
Пример #5
0
 public bool IsCompleted(Profile profile)
 {
     int n = 0;
     foreach (var v in Maps)
         if (profile.IsCompleted(v.MapName))
             n++;
     return n == Maps.Count;
 }
Пример #6
0
 public bool IsCompleted(Profile profile)
 {
     return profile.IsCompleted(MapName);
 }
Пример #7
0
 /// <summary>
 /// Money the profile can earn without unlocking a new tier
 /// </summary>
 /// <param name="profile"></param>
 /// <returns></returns>
 public int MoneyAvailableToEarn(Profile profile)
 {
     int y = 0;
     foreach (var v in profile.AvailableTiers)
     {
         var t = GetTier(v);
         foreach (var m in t.Maps)
             if (!profile.IsCompleted(m.MapName))
             {
                 y += m.Yield;
             }
     }
     return y;
 }
Пример #8
0
 public Tier GetNextTier(Profile profile, bool excludeCutsceneTiers)
 {
     var t = GetCurrentTier(profile);
     var n = t.NextTier;
     if (excludeCutsceneTiers)
     {
         while (n != null && n.Cutscene)
             n = n.NextTier;
     }
     return n;
 }
Пример #9
0
 public Tier GetCurrentTier(Profile profile)
 {
     for (int i = 1; i < Tiers.Count; i++)
         if (!Tiers[i].IsAvailable(profile))
             return Tiers[i - 1];
     return Tiers.Last();
 }
Пример #10
0
 public int CostOfNextTier(Profile profile)
 {
     var t = GetNextTier(profile, true);
     if (t == null) return 0;
     return t.Cost;
 }