You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
879 B

extends Resource
class_name MajorityJudgmentPollTally
"""
Generated by one of the implementations of
MajorityJudgmentAbstractTallier.
It should hold all the data we need to display the results.
"""
export(Resource) var poll #:MajorityJudgmentPoll
# Array of MajorityJudgmentCandidateTally
# Sorted from best to worst, sometimes arbitrary
# as some candidates may have the exact same position,
# because they have the exact same merit profile,
# so check each MajorityJudgmentCandidateTally.position.
export(Array, Resource) var candidates_tallies:Array
func get_tally_of_candidate(candidate:MajorityJudgmentCandidate) -> MajorityJudgmentCandidateTally:
for candidate_tally in self.candidates_tallies:
if candidate_tally.candidate == candidate:
return candidate_tally
assert(false, "Candidate tally not found.")
return MajorityJudgmentCandidateTally.new() # urgh