public bool vote(int uid, Voter voter) { bool success = false; if (voter != null) { success = songs[uid].vote(new Vote(voter, DateTime.Now - createdOn)); if (success) songspriority[uid] = songs[uid].getPriority(); } return success; }
public Vote(Voter voter, TimeSpan voteTime) { this.voter = voter; this.voteTime = voteTime; }
public bool isThisVoter(Voter voter) { return this.voter.Equals(voter); }
public bool addUser(Voter voter) { bool success = !voters.Contains(voter); if (success) voters.Add(voter); return success; }