예제 #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public RouteState(IRoute[] routes, RailwayState railwayState)
     : base(routes[0], railwayState)
 {
     this.routes = routes;
     permissions = new LocRoutePermissionsState(routes, railwayState);
     closed      = routes.Any(x => x.Closed);
     events      = routes.Last().Events.Select(x => new RouteEventState(x, railwayState)).ToList();
     enteringDestinationTrigger = new ActionTriggerState(routes[routes.Length - 1].EnteringDestinationTrigger, railwayState);
     destinationReachedTrigger  = new ActionTriggerState(routes[routes.Length - 1].DestinationReachedTrigger, railwayState);
 }
예제 #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public BinarySensorState(IBinarySensor sensor, RailwayState railwayState)
     : base(sensor, railwayState)
 {
     activateTrigger   = new ActionTriggerState(sensor.ActivateTrigger, railwayState);
     deActivateTrigger = new ActionTriggerState(sensor.DeActivateTrigger, railwayState);
 }