Пример #1
0
 /// <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);
     }
 }
Пример #2
0
 /// <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);
     }
 }
Пример #4
0
        /// <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);
        }