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; }
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); }
public bool IsUnlockable(Profile profile) { return IsNextTier(profile) && profile.GoldCoins >= Cost; }
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); }
public bool IsCompleted(Profile profile) { int n = 0; foreach (var v in Maps) if (profile.IsCompleted(v.MapName)) n++; return n == Maps.Count; }
public bool IsCompleted(Profile profile) { return profile.IsCompleted(MapName); }
/// <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; }
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; }
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(); }
public int CostOfNextTier(Profile profile) { var t = GetNextTier(profile, true); if (t == null) return 0; return t.Cost; }