Beispiel #1
0
        private static StationBody createStationBody(String flowID, String name)
        {
            var emitter = new Dictionary <Loko.Station.EventType, Loko.Station.EventListener>();

            emitter[EventType.Signaled] = delegate { };
            emitter[EventType.Linked]   = delegate { };
            emitter[EventType.Blocked]  = delegate { };
            emitter[EventType.Closed]   = delegate { };

            var body = new StationBody(new Station(flowID, name, emitter), emitter);

            return(body);
        }
Beispiel #2
0
        public static Boolean TryGet(String flowID, String name, out StationBody body)
        {
            body = null;

            StationCollection stations;

            if (!flows.TryGetValue(flowID, out stations))
            {
                return(false);
            }

            if (!stations.TryGetValue(name, out body))
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
 public static Boolean TryGet(Metro.Api.Station station, out StationBody body) => TryGet(station.Id, station.Name, out body);