Exemple #1
0
 public void Add(Socket socket, String userName, String roomName)
 {
     numActors++;
     num++;
     User newUser = new User(numActors, socket, userName, roomName);
     newUser.next = first;
     first = newUser;
     Debug.Log ("New user created!");
 }
Exemple #2
0
        //Remove the user using their socket
        public void Remove(Socket soc)
        {
            User current = first;
            User previous = null;
            while (current.Soc != soc) {
                if (current.next == null) {
                    return;
                } else {
                    previous = current;
                    current = current.next;
                }
            }

            if (current == first) {
                first = first.next;
                num--;
            } else {
                previous.next = current.next;
            }
        }
Exemple #3
0
 public UserList()
 {
     first = null;
 }
Exemple #4
0
        //Remove the user using their actor ID
        public void Remove(int actorId)
        {
            User current = first;
            User previous = first;
            while (current.actorId != actorId) {
                if (current.next == null) {
                    return;
                } else {
                    previous = current;
                    current = current.next;
                }
            }

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