public void DropUser(UserData u) { foreach (var kp in u.channels) { kp.Key.users.Remove(u); } _users.Remove(u); }
internal User(UserData ud) { _nick = ud.nick; _host = ud.host; _isClient = ud.isclient; _isIncomplete = ud.incomplete; _channels = new Dictionary<string, UserMode>(); foreach (KeyValuePair<ChannelData, UserMode> kp in ud.channels) { _channels.Add(kp.Key.name, kp.Value); } }
public EntityManager(string initNick) { _channels = new HashSet<ChannelData>(); _users = new HashSet<UserData>(); _self = new UserData(this, initNick, true); }
public void UnsetUserMode(ChannelData c, UserData u, UserMode um) { if (u.channels.ContainsKey(c)) { u.channels[c] &= ~um; } }
public void Unjoin(ChannelData c, UserData u) { c.users.Remove(u); u.channels.Remove(c); if (c.users.Count == 0) _channels.Remove(c); if (u.channels.Count == 0) _users.Remove(u); }
public void Join(ChannelData c, UserData u) { c.users.Add(u); u.AddChannel(c); _channels.Add(c); _users.Add(u); }