public RailLine(ModelStorage db, ModelListener lis) { storage = db; listener = lis; storage.Add(this); listener.Fire(EventType.CREATED, this); }
public Action(ModelStorage db, ModelListener lis, ModelFactory f) { storage = db; listener = lis; factory = f; Actions = new LinkedList <Transactional>(); }
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); }
public StayTask(ModelListener lis, Train t, DeptTask dept, OnComplete fn) : base(t, fn) { org = dept; listener = lis; onComplete = () => { // 積み残しがあるまま発車 InQueue.ToList().ForEach(h => { h.State = Human.StateType.WAIT_TRAIN_ARRIVAL; h.OnTrain = null; }); fn(); }; org = dept; OutQueue = new LinkedList <Human>(); InQueue = new LinkedList <Human>(); org.Trains.Add(train); }
public void removeListener(ModelListener l) { scheduler.Add(() => { if (registeredListeners.Contains(l)) { registeredListeners.Remove(l); } }); }
public void addListener(ModelListener l) { scheduler.Add(() => { if (!registeredListeners.Contains(l)) { registeredListeners.Add(l); } }); }
public void addModelListener(ModelListener l) { modelListeners.Add(l); }
public void unregisterModelListener(ModelListener listener) { _service.unregisterModelListener(listener, _caller); }
public WaitEvent(ModelListener lis, Human.StateType s) { state = s; listener = lis; }
protected LineTask(ModelStorage db, ModelListener lis) { Trains = new List <Train>(); listener = lis; storage = db; }
public void unregisterModelListener(ModelListener listener, String callerPath) { modelListeners.removeListener(listener); }
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); }
public TrainExecutor(ModelListener lis, Train t, LineTask lt) { listener = lis; train = t; Current = Generate(lt, () => Next()); }
public CreateLineAction(ModelStorage db, ModelListener lis, RailLine line, RollbackFn fn) : this(db, lis) { prevLine = line; rollback = fn; }
public CreateLineAction(ModelStorage db, ModelListener lis) { storage = db; listener = lis; }
public TestUtils() { storage = new GameObject().AddComponent <ModelStorage>(); listener = new GameObject().AddComponent <ModelListener>(); factory = new GameObject().AddComponent <ModelFactory>(); var co = new GameObject(); co.AddComponent <SpriteRenderer>(); factory.c = c = co.AddComponent <Company>(); var ro = new GameObject(); ro.AddComponent <SpriteRenderer>(); factory.r = r = ro.AddComponent <Residence>(); factory.rn = rn = new GameObject().AddComponent <RailNode>(); factory.re = re = new GameObject().AddComponent <RailEdge>(); var rpo = new GameObject(); rpo.AddComponent <MeshRenderer>(); factory.rp = rp = rpo.AddComponent <RailPart>(); var sto = new GameObject(); sto.AddComponent <SpriteRenderer>(); factory.st = st = sto.AddComponent <Station>(); factory.p = p = new GameObject().AddComponent <Platform>(); factory.g = g = new GameObject().AddComponent <Gate>(); var to = new GameObject(); to.AddComponent <SpriteRenderer>(); factory.t = t = to.AddComponent <Train>(); var ho = new GameObject(); ho.AddComponent <SpriteRenderer>(); factory.h = h = ho.AddComponent <Human>(); var ureso = new GameObject(); ures = ureso.AddComponent <UserResource>(); var transo = new GameObject(); trans = transo.AddComponent <Transport>(); var routeo = new GameObject(); route = routeo.AddComponent <Route>(); route.trans = trans; c.listener = r.listener = rn.listener = re.listener = rp.listener = st.listener = p.listener = g.listener = t.listener = h.listener = ures.listener = trans.listener = route.listener = listener; c.storage = r.storage = rn.storage = re.storage = rp.storage = st.storage = p.storage = g.storage = t.storage = h.storage = ures.storage = trans.storage = route.storage = storage; r.factory = rn.factory = re.factory = st.factory = ures.factory = factory; t.resource = trans.resource = route.resource = ures; }
public RouterImpl(ModelListener lis, Gate g) { listener = lis; parent = g; }
public LineTask(ModelStorage db, ModelListener lis, RailLine line, LineTask lt) : this(db, lis) { Parent = line; Prev = lt; Prev.Next = this; }
public void registerModelListener(ModelListener listener, String callerPath) { modelListeners.addListener(listener); }