Ejemplo n.º 1
0
 public BehaverBridge(Behaver _behaverFront, BridgeHelperFactoryBridge _helperFactory)
 {
     helperFactory          = _helperFactory;
     behaverFront           = _behaverFront;
     matchAttributeCallback = (newAttributeGBlockPtr) => {
         try {
             var gBlock = NativeGrammarBlockUtils.GBlockPtrToGBlock(newAttributeGBlockPtr);
             var bf     = this.behaverFront;
             return((int)behaverFront.MatchAttribue(gBlock));
         } catch (System.Exception e) {
             Debug.LogError(e);
             return((int)AttributeMatchResult.NEUTRAL);
         }
     };
     setBehaviorCallback = (behaviorExpression, listener) => {
         try {
             var gBlock = NativeGrammarBlockUtils.GBlockPtrToGBlock(behaviorExpression);
             behaverFront.ReadyBehavior(GrammarBlockUtils.GBlockToBExpression(gBlock), new NativeBehaviorRequestListener(listener, helperFactory));
             Debug.Log("READY Set Behaver Front behavior: " + gBlock.cluster.blocks[1].unit.word);
         } catch (Exception e) {
             Debug.LogError(e);
         }
     };
     checkBehaviorCallback = (behaviorExpression, listener) => {
         try {
             var gBlock = NativeGrammarBlockUtils.GBlockPtrToGBlock(behaviorExpression);
             behaverFront.ReadyCheckBehavior(GrammarBlockUtils.GBlockToBExpression(gBlock), new NativeBehaviorCheckRequestListener(listener, helperFactory));
             Debug.Log("READY Check Behaver Front behavior: " + gBlock.cluster.blocks[1].unit.word);
         } catch (Exception e) { Debug.LogError(e); }
     };
 }
Ejemplo n.º 2
0
 public NativeBehaviorTrigger(System.IntPtr _implPtr, BridgeHelperFactoryBridge _helperFacytory)
 {
     helperFacytory = _helperFacytory;
     implPtr        = _implPtr;
 }
Ejemplo n.º 3
0
 public NativeBehaviorRequestListener(System.IntPtr _implPtr, BridgeHelperFactoryBridge _helperFacytory)
 {
     helperFacytory = _helperFacytory;
     implPtr        = _implPtr;
 }
Ejemplo n.º 4
0
 public BehaverFactoryBridge(ImmediateGiver <Behaver, GrammarBlock> _behaverGiver, BridgeHelperFactoryBridge _helperFactory)
 {
     behaverGiver = _behaverGiver;
     behaverFrontFactoryCallback = (factoryAgent, baseAttributeGBlock) => {
         try {
             var picked = behaverGiver.PickBestElement(NativeGrammarBlockUtils.GBlockPtrToGBlock(baseAttributeGBlock));
             if (picked != null)
             {
                 behavers.Add(new BehaverBridge(picked, _helperFactory));
                 ReadyBehaver(factoryAgent, behavers.Last().matchAttributeCallback, behavers.Last().setBehaviorCallback, behavers.Last().checkBehaviorCallback);
             }
         } catch (System.Exception e) {
             Debug.LogError(e);
         }
     };
     nativeFactoryPtr = _helperFactory.NewBehaverFactory(behaverFrontFactoryCallback);
 }
Ejemplo n.º 5
0
 public ConfigurableEWRIptrFactory(BridgeHelperFactoryBridge _helperFactory)
 {
     helperFactory = _helperFactory;
     implPtr       = NewConfigurableTEIptrFactory();
 }
Ejemplo n.º 6
0
 public NativeConfigurableERWInterpreter(System.IntPtr _implPtr, BridgeHelperFactoryBridge _helperFactory)
 {
     helperFactory = _helperFactory;
     implPtr       = _implPtr;
 }