void OnHumanDestroyed(ComplexHumanGlobalEvent e) { if (_dict.TryGetValue(e.Human.Persona, out var node)) { _dict.Remove(e.Human.Persona); _list.Remove(node); e.Human.Dispose(); fire(new HumanUnregistered(e.Human)); } }
void OnHumanCreated(ComplexHumanGlobalEvent e) { OnHumanDestroyed(e); _dict[e.Human.Persona] = _list.AddLast(e.Human); fire(new HumanRegistered(e.Human)); }