コード例 #1
0
ファイル: Room.cs プロジェクト: TheProxor/Unity-Server-PGN
 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);
 }
コード例 #2
0
ファイル: Lobby.cs プロジェクト: TheProxor/Unity-Server-PGN
 public Lobby(RoomFactor.RoomCount count, RoomFactor.RoomMode mode, RoomFactor.RoomMap map, string roomFactorKey, string name) : base(count, mode, map, roomFactorKey, name)
 {
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
        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);
        }
コード例 #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;
 }