Exemplo n.º 1
0
 public Statistic(Room r)
 {
     Users = new List<User>(r.Players);
     Users.Sort(delegate(User user1, User user2)
     {
         return user2.Point.CompareTo(user1.Point);
     });
 }
Exemplo n.º 2
0
        public void joinQueue(string user)
        {
            if (!queue.Contains(user))
            {
                queue.Add(user);
                Logger.log(Errorlevel.INFO, user + " joined queue");

                if (queue.Count >= Room.MAXPLAYERS)
                {
                    Room r = new Room();

                    for (int i = 0; i < Room.MAXPLAYERS; i++)
                    {
                        r.addUser(onlineUsers.Find(x => x.Name.Equals(queue[0])));
                        queue.RemoveAt(0);
                    }
                    r.start();

                    rooms.Add(r);
                    Logger.log(Errorlevel.INFO, r.Name + " room created!");
                }
            }
            else
            {
                Logger.log(Errorlevel.ERROR, user + "tried to join queue twice!");
            }
        }