Beispiel #1
0
        internal static ConceptInstance Create(BeamGenerator generator, PropertySetTarget target, ConceptInstance value)
        {
            var rememberValue = new ConceptInstance(Concept2.RememberPropertyValue);

            generator.SetValue(rememberValue, Concept2.Target, target.Instance);
            generator.SetValue(rememberValue, Concept2.TargetProperty, new ConceptInstance(target.Property));
            generator.SetValue(rememberValue, Concept2.Subject, value);

            return(rememberValue);
        }
Beispiel #2
0
        internal AbilityBase SetValues(Concept2 target, Concept2 property, params Concept2[] values)
        {
            var setTarget = new PropertySetTarget(target, property);

            foreach (var value in values)
            {
                AddInitializationEvent(new PropertySetEvent(setTarget, new ConceptInstance(value)));
            }

            return(this);
        }
Beispiel #3
0
        protected override void onInstanceActivated(ConceptInstance instance, BeamGenerator generator)
        {
            var property = generator.GetValue(instance, Concept2.Property);
            var target   = generator.GetValue(instance, Concept2.Target);

            var setTarget = new PropertySetTarget(target, Concept2.HasProperty);
            var evt       = new PropertySetEvent(setTarget, property, allowActivation: false);

            generator.Push(evt);
            generator.Push(new ExportEvent(evt));
        }
Beispiel #4
0
        internal AbilityBase DefineProperty(Concept2 property, params Concept2[] domain)
        {
            var target = new PropertySetTarget(property, Concept2.PropertyDomain);

            foreach (var domainValue in domain)
            {
                var domainValueInstance = new ConceptInstance(domainValue);
                AddInitializationEvent(new PropertySetEvent(target, domainValueInstance));
            }

            return(this);
        }
Beispiel #5
0
        protected override void onInstanceActivated(ConceptInstance instance, BeamGenerator generator)
        {
            var target         = generator.GetValue(instance, Concept2.Target);
            var targetProperty = generator.GetValue(instance, Concept2.TargetProperty);
            var subject        = generator.GetValue(instance, Concept2.Subject);

            var generalTarget = new PropertySetTarget(target.Concept, targetProperty.Concept);
            var setEvent      = new PropertySetEvent(generalTarget, subject);

            generator.Push(new ExportEvent(setEvent));
            generator.Push(setEvent);
            if (generator.IsDefined(instance.Concept))
            {
                generator.Push(new InstanceOutputEvent(instance));
            }
        }
Beispiel #6
0
        internal virtual void Visit(IncompleteRelationEvent evt)
        {
            if (evt.IsFilled)
            {
                var target = new PropertySetTarget(evt.Subject, evt.Property);
                Push(new CloseEvent(evt));
                Push(new PropertySetEvent(target, evt.Value));
            }
            else
            {
                //try to fill by some free active instance
                var completeInstances = GetAvailableActiveInstances();
                tryToFillBy(evt, completeInstances);

                //or keep unfilled
                PushSelf();
            }
        }
 public PropertySetEvent(PropertySetTarget target, ConceptInstance value, bool allowActivation = true)
 {
     Target           = target;
     SubstitutedValue = value;
     AllowActivation  = allowActivation;
 }
 public SubstitutionRequestEvent_old(PropertySetTarget target, ConceptInstance activationTarget = null)
 {
     Target           = target;
     ActivationTarget = activationTarget;
 }
 public SubstitutionRequestEvent_old(ConceptInstance targetInstance, ParamDefinedEvent parameterDefinition)
 {
     Target = new PropertySetTarget(targetInstance, parameterDefinition.Property);
 }