Beispiel #1
0
        /// <summary>
        /// Add a team to the TeamDictionary
        /// </summary>
        /// <param name="entity"</param>
        /// <param name="team"></param>
        public void Add(Entity entity, Team team)
        {
            TeamDictionary.Add(entity, team);

            if (currentTeam == null)
            {
                currentTeam = team;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Advance turn to the next Team in the list
        /// </summary>
        public void AdvanceTurn()
        {
            List<Team> teamList = TeamDictionary.Values.Distinct().ToList();

            if (currentTeam != null)
            {
                int index = teamList.IndexOf(currentTeam) + 1;

                if (index < teamList.Count)
                    currentTeam = teamList.ElementAt(index);
                else
                    currentTeam = teamList.First();
            }
        }