/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public void CollectUsageInfo(IEntity subject, UsedByInfos results) { foreach (IEntityInternals entity in this) { entity.CollectUsageInfo(subject, results); } }
/// <summary> /// Find all entities that use this entity. /// </summary> public UsedByInfos GetUsageInfo() { var result = new UsedByInfos(); Root.CollectUsageInfo(this, result); return(result); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); if (locs.Contains(subject as Loc)) { results.UsedBy(this, Strings.UsedByMemberOfGroup); } }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); if (subject == Block) { results.UsedBy(this, Strings.UsedBySensor); } }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); if (Group == subject) { results.UsedBy(this, Strings.UsedByPermission); } }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); foreach (var p in predicates) { p.CollectUsageInfo(subject, results); } }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); commandStationRefs.CollectUsageInfo(subject, results); locRefs.CollectUsageInfo(subject, results); moduleRefs.CollectUsageInfo(subject, results); moduleConnections.CollectUsageInfo(subject, results); locGroups.CollectUsageInfo(subject, results); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); T entity; if (TryResolve(out entity)) { ((IEntityInternals)entity).CollectUsageInfo(subject, results); } }
/// <summary> /// Find all entities that use this entity. /// </summary> public UsedByInfos GetUsageInfo() { var result = new UsedByInfos(); if (Junction != null) { var railway = (Railway)Junction.Module.Package.Railway; railway.CollectUsageInfo(this, result); } return(result); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); blocks.CollectUsageInfo(subject, results); junctions.CollectUsageInfo(subject, results); routes.CollectUsageInfo(subject, results); edges.CollectUsageInfo(subject, results); sensors.CollectUsageInfo(subject, results); signals.CollectUsageInfo(subject, results); outputs.CollectUsageInfo(subject, results); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); if (subject == From) { results.UsedBy(this, Strings.UsedByRouteAsFrom); } if (subject == To) { results.UsedBy(this, Strings.UsedByRouteAsTo); } if (crossingJunctions.Contains(subject as IJunction)) { results.UsedBy(this, Strings.UsedByRouteAsCrossingJunction); } var @event = events.FirstOrDefault(x => x.Sensor == subject); if (@event != null) { if (@event.Behaviors.Any(x => x.StateBehavior == RouteStateBehavior.Enter)) { results.UsedBy(this, Strings.UsedByRouteAsEnteringSensor); } if (@event.Behaviors.Any(x => x.StateBehavior == RouteStateBehavior.Reached)) { results.UsedBy(this, Strings.UsedByRouteAsReachedSensor); } if (@event.Behaviors.Any(x => (x.StateBehavior != RouteStateBehavior.Reached) && (x.StateBehavior != RouteStateBehavior.Enter))) { results.UsedBy(this, Strings.UsedByRouteAsOtherSensor); } } permissions.CollectUsageInfo(subject, results); enteringDestinationTrigger.CollectUsageInfo(subject, results); destinationReachedTrigger.CollectUsageInfo(subject, results); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos result) { // Do nothing here }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); includes.CollectUsageInfo(subject, results); excludes.CollectUsageInfo(subject, results); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public override void CollectUsageInfo(IEntity subject, UsedByInfos results) { base.CollectUsageInfo(subject, results); activateTrigger.CollectUsageInfo(subject, results); deActivateTrigger.CollectUsageInfo(subject, results); }
/// <summary> /// If this entity uses the given subject, add a <see cref="UsedByInfo"/> entry to /// the given result. /// </summary> public virtual void CollectUsageInfo(IEntity subject, UsedByInfos results) { // Do nothing here, override me }