public RailLine(ModelStorage db, ModelListener lis) { storage = db; listener = lis; storage.Add(this); listener.Fire(EventType.CREATED, this); }
private void Start() { if (isTemplate) { listener.Add <RailNode>(EventType.CREATED, rn => storage.Add(rn)); listener.Add <RailNode>(EventType.DELETED, rn => storage.Remove(rn)); } }
private void Start() { if (isTemplate) { listener.Add <Station>(EventType.CREATED, st => storage.Add(st)); listener.Add <Station>(EventType.DELETED, st => storage.Remove(st)); } }
public DeptTask(ModelStorage db, ModelListener lis, RailLine l, Platform p, LineTask lt) : base(db, lis, l, lt) { Stay = p; Stay.Depts.AddLast(this); db.Add(this); Queue = new LinkedList <Human>(); router = new RouterImpl(this); listener.Fire(EventType.CREATED, this); }
private void Start() { if (isTemplate) { listener.Add <RailPart>(EventType.CREATED, rp => storage.Add(rp)); listener.Add <RailPart>(EventType.DELETED, rp => storage.Remove(rp)); } else { listener.Add <RailPart>(EventType.MODIFIED, this, (_) => SetTransform()); } }
private void Start() { if (isTemplate) { listener.Add <RailEdge>(EventType.CREATED, re => storage.Add(re)); listener.Add <RailEdge>(EventType.DELETED, re => storage.Remove(re)); } else { listener.Add <RailEdge>(EventType.MODIFIED, this, (_) => { listener.Fire(EventType.MODIFIED, ForwardPart); listener.Fire(EventType.MODIFIED, BackPart); }); } }
public EdgeTask(ModelStorage db, ModelListener lis, RailLine l, RailEdge re, LineTask lt) : base(db, lis, l, lt) { Edge = re; db.Add(this); listener.Fire(EventType.CREATED, this); }