コード例 #1
0
ファイル: EntityView.cs プロジェクト: jannickj/XmasEngine
 /// <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);
 }
コード例 #2
0
ファイル: ConsoleView.cs プロジェクト: jannickj/multipacman
 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));
 }