private static void CreateRoom(User user, string roomFactorsKey, RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, List <Room> rooms)
        {
            Room room = new Room(count, mode, map, roomFactorsKey);

            room.JoinToRoom(user);
            rooms.Add(room);
        }
Exemplo n.º 2
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);
 }
 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();
     }
 }
Exemplo n.º 4
0
 public Lobby(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey, string name) : base(count, mode, map, roomFactorKey, name)
 {
 }
Exemplo n.º 5
0
 public DefaultRoom(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey, string name) : base(count, mode, map, roomFactorKey, name)
 {
     instance = this;
 }