/// <summary> /// Constructs a new EntityView /// </summary> /// <param name="model">The entity that view is meant to show</param> /// <param name="position">The position of the entity</param> /// <param name="tman">The ThreadSafeEventManager that is controlled the XmasView</param> public EntityView(XmasEntity model, XmasPosition position, ThreadSafeEventManager tman) { this.model = model; this.Position = position; eventqueue = model.ConstructEventQueue(); tman.AddEventQueue(eventqueue); }
public ConsoleView(XmasModel model, Point drawPos, ConsoleWorldView viewWorld, ConsoleViewFactory entityFactory, ThreadSafeEventManager evtmanager) : base(evtmanager) { this.viewWorld = viewWorld; this.entityFactory = entityFactory; this.drawPos = drawPos; eventqueue = model.EventManager.ConstructEventQueue(); evtmanager.AddEventQueue(eventqueue); eventqueue.Register(new Trigger<EntityAddedEvent>(Model_EntityAdded)); eventqueue.Register(new Trigger<EntityRemovedEvent>(model_EntityRemoved)); }