Ejemplo n.º 1
0
 public void Add(Socket creatorSoc, string roomName, int max)
 {
     numRooms++;
     num++;
     List<Socket> userSocs = new List<Socket> ();
     userSocs.Add (creatorSoc);
     Room newRoom = new Room (numRooms * 1000, creatorSoc, roomName, userSocs, max);
     newRoom.next = first;
     first = newRoom;
     Debug.Log ("New room has been created!");
 }
Ejemplo n.º 2
0
 public RoomList()
 {
     first = null;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Remove the specified room.
        /// </summary>
        public bool Remove(String roomName)
        {
            Room current = first;
            Room previous = null;

            while (current.roomName != roomName) {
                if (current.next == null) {
                    return false;
                } else {
                    previous = current;
                    current = current.next;
                }
            }

            if (current == first) {
                first = first.next;
                num--;
            } else {
                previous.next = current.next;
            }

            return true;
        }