Exemplo n.º 1
0
            public void AddPlayer(IemUtils.IIemTeamPlayer player)
            {
                if (player.Team != null && player.Team != this)
                {
                    me.Puts("removing palyer from team " + player.Team.Name);
                    player.Team.RemovePlayer(player);
                }

                if (!Players.ContainsKey(player.PlayerId))
                {
                    Players.Add(player.PlayerId, player);
                }

                player.Team     = this;
                player.TeamGame = TeamGame;

                if (!TeamGame.Players.ContainsKey(player.PlayerId))
                {
                    TeamGame.Players.Add(player.PlayerId, player);
                }

                if (Players.Count > 0)
                {
                    State = IemUtils.TeamState.Before;
                }
            }
Exemplo n.º 2
0
 public IemTeam()
 {
     Players = new Dictionary <string, IemUtils.IIemTeamPlayer>();
     Score   = 0;
     State   = IemUtils.TeamState.Empty;
     _guid   = Guid.NewGuid();
 }
Exemplo n.º 3
0
            public void RemovePlayer(IemUtils.IIemTeamPlayer player)
            {
                if (Players.ContainsKey(player.PlayerId))
                {
                    Players.Remove(player.PlayerId);
                }
                player.Team = null;

                if (Players.Count == 0)
                {
                    State = IemUtils.TeamState.Empty;
                }
            }