public void removeVote(Vote vote) { List <Player> playersNowVoting = new List <Player>(); foreach (Player playerVoting in PlayersVoting) { if (playerVoting.Name.Equals(vote.PlayerVoting.Name)) { if (!PostNumbers.Contains(vote.PostNumber)) { PostNumbers.Add(vote.PostNumber); PostBBCodeList.Add(vote.PostBBCode); UnvoteList.Add(true); if (vote.Timestamp > MaxTimeStamp) { MaxTimeStamp = vote.Timestamp; } if (vote != null) { AllVotesRelevantToWagon.Add(vote); } } } else { playersNowVoting.Add(playerVoting); } } //l_Level = maxThreshold - playersNowVoting.Count; PlayersVoting = playersNowVoting; }
public void addVote(Vote vote) { PlayersVoting.Add(vote.PlayerVoting); if (PlayerBeingVoted == null) { PlayerBeingVoted = vote.PlayerVoted; } vote.PlayerVoting.PlayerCurrentlyVoting = vote.PlayerVoted; if (!PostNumbers.Contains(vote.PostNumber)) { vote.PlayerVoting.PostNumberOfVote = vote.PostNumber; PostNumbers.Add(vote.PostNumber); PostBBCodeList.Add(vote.PostBBCode); UnvoteList.Add(false); if (vote.Timestamp > MaxTimeStamp) { MaxTimeStamp = vote.Timestamp; } if (vote != null) { AllVotesRelevantToWagon.Add(vote); } } else { UnityEngine.Debug.Log("Post data got corrupted."); } if (L_Level == 1 && PlayerBeingVoted.IsHated) { IsHammered = true; } else if (L_Level == 0 && !PlayerBeingVoted.IsLoved) { IsHammered = true; } else if (L_Level == -1 && PlayerBeingVoted.IsLoved) { IsHammered = true; } }