Exemple #1
0
 public Room(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey)
 {
     this.roomFactorKey = roomFactorKey;
     if (count != null)
     {
         this.count = count;
     }
     else
     {
         this.count = new RoomFactor.RoomCount(uint.MaxValue);
     }
     this.map  = map;
     this.mode = mode;
     id        = Guid.NewGuid().ToString();
     MatchmakingController.rooms.Add(id, this);
 }
Exemple #2
0
 public Lobby(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey, string name) : base(count, mode, map, roomFactorKey, name)
 {
 }
 private static void GetFactorKey(out string key, out RoomFactor.RoomCount count, out RoomFactor.RoomMode mode, out RoomFactor.RoomMap map, RoomFactor[] roomFactors)
 {
     key   = "none";
     count = null;
     mode  = null;
     map   = null;
     foreach (RoomFactor factor in roomFactors)
     {
         if (factor is RoomFactor.RoomCount)
         {
             count = factor as RoomFactor.RoomCount;
         }
         else if (factor is RoomFactor.RoomMode)
         {
             mode = factor as RoomFactor.RoomMode;
         }
         else if (factor is RoomFactor.RoomMap)
         {
             map = factor as RoomFactor.RoomMap;
         }
         key += factor.GetFactorUssage();
     }
 }
        private static void CreateRoom(User user, string roomFactorsKey, RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map)
        {
            Room room = new Room(count, mode, map, roomFactorsKey);

            room.JoinToRoom(user);
            List <Room> rooms = new List <Room>();

            rooms.Add(room);
            matchmakingRooms.Add(roomFactorsKey, rooms);
        }
 public DefaultRoom(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey, string name) : base(count, mode, map, roomFactorKey, name)
 {
     instance = this;
 }