Example #1
0
        public void Create(List <int> teamOne, List <int> teamTwo)
        {
            SelectRoom room;

            if (!cacheRooms.TryPop(out room))
            {
                room = new SelectRoom();
                //添加唯一ID
                room.SetArea(AddIndex);
            }
            //房间数据初始化
            room.Init(teamOne, teamTwo);
            foreach (int item in teamOne)
            {
                userRoom.TryAdd(item, room.GetArea());
            }
            foreach (int item in teamTwo)
            {
                userRoom.TryAdd(item, room.GetArea());
            }

            roomMap.TryAdd(room.GetArea(), room);
        }
Example #2
0
        public void Create(List<int> teamOne, List<int> teamTwo)
        {
            SelectRoom room;
            if(!cacheRooms.TryPop(out room))
            {
                room = new SelectRoom();
                //添加唯一ID
                room.SetArea(AddIndex);
            }
            //房间数据初始化
            room.Init(teamOne,teamTwo);
            foreach (int item in teamOne)
            {
                userRoom.TryAdd(item, room.GetArea());
            }
            foreach (int item in teamTwo)
            {
                userRoom.TryAdd(item, room.GetArea());
            }

            roomMap.TryAdd(room.GetArea(), room);
        }