public override bool Equivalent(Vote vote)
        {
            var infantryVote = vote as MoveInfantryVote;
            if (infantryVote == null)
            {
                return false;
            }

            return (infantryVote.UnitId == UnitId &&
                    infantryVote.X == X &&
                    infantryVote.Y == Y);
        }
        public void VoteAction(Vote vote)
        {
            Console.WriteLine("Vote Recorded " + vote.Generation);

            bool found = false;
            foreach (var v in votes)
            {
                if (v.Equivalent(vote))
                {
                    found = true;
                    v.Count++;
                    break;
                }
            }
            if (!found)
            {
                vote.Count = 1;
                votes.Add(vote);
            }
        }
Beispiel #3
0
 public abstract bool Equivalent(Vote vote);