public List<Rank> GetHighestQualifiedRank(ParticipationRecord record, out string missingRequirements) { missingRequirements = "Satisfied"; List<Rank> qualifiedRanks; Rank previousRank = GetPreviousRank(); if (previousRank == null) qualifiedRanks = new List<Rank>(); else { qualifiedRanks = previousRank.GetHighestQualifiedRank(record, out missingRequirements); } if (DoesRankMeetCriteria(record) && (qualifiedRanks.Contains(previousRank) || previousRank == null)) { ConsumeRecord(record); qualifiedRanks.Add(this); missingRequirements = "Satisfied"; } else { if (missingRequirements == "Satisfied") missingRequirements = this.ExplainMissingRequirements(record); } return qualifiedRanks; }
public override void Deduct(ParticipationRecord ParticipationRecord) { ArtsParticipationRecord artsRecord = (ArtsParticipationRecord)ParticipationRecord; DemoParticipations -= artsRecord.DemoParticipations; WarParticipations -= artsRecord.WarParticipations; for (int i = artsRecord.JourneymanListParticipations; i > 0; i--) { if (JourneymanListParticipations > 0) JourneymanListParticipations--; else if (KnightsListParticipations > 0) KnightsListParticipations--; else JourneymanListParticipations--; } for (int i = artsRecord.JourneymanListWins; i >0; i--) { if (JourneymanListWins > 0) JourneymanListWins--; else if (KnightsListWins > 0) KnightsListWins--; else JourneymanListWins--; } KnightsListParticipations -= artsRecord.KnightsListParticipations; KnightsListWins -= artsRecord.KnightsListWins; MasterworksMade -= artsRecord.MasterworksMade; }
protected abstract string ExplainMissingRequirements(ParticipationRecord record);
protected abstract bool DoesRankMeetCriteria(ParticipationRecord record);
protected abstract void ConsumeRecord(ParticipationRecord record);
public abstract void Deduct(ParticipationRecord ParticipationRecord);