using System; using System.Collections.Generic; using System.Linq; namespace RecRoom.Challenges { // Token: 0x02000AFA RID: 2810 public class Challenge : ChallengeBase { // Token: 0x06015A50 RID: 88656 RVA: 0x00604400 File Offset: 0x00602600 public Challenge() { this.IgnorePreviousCompletions = false; } // Token: 0x06015A51 RID: 88657 RVA: 0x00604428 File Offset: 0x00602628 protected bool EvalutateConditions(ChallengeEvents.IChallengeEventData challengeEventData) { List list = this.ResetConditions.Select((IChallenge _) => _.Evaluate(challengeEventData)).ToList(); bool flag = list.Any((bool _) => _); if (flag) { this.Reset(); } List list2 = this.WithConditions.Select((IChallenge _) => _.Evaluate(challengeEventData)).ToList(); bool flag2; if (list2.Count() > 0) { flag2 = list2.All((bool _) => _); } else { flag2 = false; } bool flag3 = flag2; base.Dirty |= this.WithConditions.Any((IChallenge _) => _.Dirty); return flag3; } // Token: 0x06015A52 RID: 88658 RVA: 0x00604518 File Offset: 0x00602718 protected override bool EvaluateInternal(ChallengeEvents.IChallengeEventData challengeEventData) { return this.EvalutateConditions(challengeEventData); } // Token: 0x06015A53 RID: 88659 RVA: 0x00604524 File Offset: 0x00602724 public override void Reset() { base.Reset(); this.ResetChildren(); } // Token: 0x06015A54 RID: 88660 RVA: 0x00604534 File Offset: 0x00602734 protected void ResetChildren() { foreach (IChallenge challenge in this.WithConditions) { challenge.Reset(); } foreach (IChallenge challenge2 in this.ResetConditions) { challenge2.Reset(); } } // Token: 0x06015A55 RID: 88661 RVA: 0x006045DC File Offset: 0x006027DC public override Dictionary Serialize() { Dictionary dictionary = base.Serialize(); List> list = (from _ in this.ResetConditions where !_.SkipSerialization select _.Serialize()).ToList>(); List> list2 = (from _ in this.WithConditions where !_.SkipSerialization select _.Serialize()).ToList>(); if (list.Count > 0) { dictionary["rc"] = list; } if (list2.Count > 0) { dictionary["wc"] = list2; } return dictionary; } // Token: 0x06015A56 RID: 88662 RVA: 0x006046C4 File Offset: 0x006028C4 protected override void DeserializeInternal(Dictionary jsonDict) { this.ResetConditions = ChallengeParser.GetChallengeSet("rc", jsonDict); this.WithConditions = ChallengeParser.GetChallengeSet("wc", jsonDict); } // Token: 0x170008DB RID: 2267 // (get) Token: 0x06015A57 RID: 88663 RVA: 0x006046E8 File Offset: 0x006028E8 public override ChallengeTypes ChallengeType { get { return ChallengeTypes.Challenge; } } // Token: 0x04003BFB RID: 15355 public List WithConditions = new List(); // Token: 0x04003BFC RID: 15356 public List ResetConditions = new List(); // Token: 0x04003BFD RID: 15357 public const string RESET_CONDITIONS_KEY = "rc"; // Token: 0x04003BFE RID: 15358 public const string WITH_CONDITIONS_KEY = "wc"; } }