using System.Collections.Generic; using Common.Base; using MongoDB.Bson; namespace Model { public class ActorComponent : Component { private readonly Dictionary actors = new Dictionary(); public Actor Get(ObjectId id) { return this.actors[id]; } public void Add(Actor actor) { this.actors[actor.Id] = actor; } public void Remove(ObjectId id) { Actor actor = this.Get(id); this.actors.Remove(id); actor.Dispose(); } } }