예제 #1
0
 void AssetReferInterface.PickContent <ContentType>(string path, Taker <ContentType> collector)
 {
     if (string.IsNullOrEmpty(path))
     {
         if (typeof(ContentType) == typeof(MonoBAUICustomizer))
         {
             basicAssetIO.assetOut.PickAssetAtPath("Customizer.prefab", new StdBridgeBasicColl <ContentType> {
                 collector = collector
             });
         }
         else if (typeof(ContentType) == typeof(MonoBAUIntegrator))
         {
             basicAssetIO.assetOut.PickAssetAtPath("Integrator.prefab", new StdBridgeBasicColl <ContentType> {
                 collector = collector
             });
         }
         else
         {
             collector.None();
         }
     }
     else
     {
         basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ContentType> {
             collector = collector
         });
     }
 }
예제 #2
0
        IEnumerator RemoteSPCo(string eWords, Taker <GrammarBlock> listener)
        {
            inteceptHelper.OnBeginSession(listener);
            var  form       = new WWWForm();
            bool didCollect = false;

            form.AddBinaryData("ewords", System.Text.Encoding.UTF8.GetBytes(eWords));
            UnityWebRequest www = UnityWebRequest.Post(uri, form);

            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log("HTML_MonoBLProcessor: " + www.error);
            }
            else
            {
                Debug.Log(Encoding.UTF8.GetString(www.downloadHandler.data));
                var gblock = RequiredFuncs.FromJson <DeserializedGBlock>(www.downloadHandler.data);
                listener.Take(gblock);
                didCollect = true;
            }
            inteceptHelper.OnEndSession(listener);
            if (!didCollect)
            {
                listener.None();
            }
        }
예제 #3
0
 void Taker <ContentType> .None()
 {
     if (enumerator.MoveNext())
     {
         enumerator.Current.referer.PickContent(path, this);
     }
     else
     {
         clientTaker.None();
     }
 }
예제 #4
0
파일: StdMAnlys.cs 프로젝트: iwaag/AGBLang
        void MorphemeAnalyzer.AnalyzeFormat(string naturalLanguage, Taker <DivisibleEnumerable <Morpheme> > listener)
        {
            var result = AnalyzeImmediate(naturalLanguage);

            if (result != null)
            {
                listener.Take(result);
            }
            else
            {
                listener.None();
            }
        }
예제 #5
0
        void AssetMediator.SeekAsset <ContentType>(GrammarBlock gBlock, Taker <ContentType> collLis)
        {
            var implementer = implementerGetter.assetImplGetter.GetAssetImplementer <ContentType>(gBlock);

            if (implementer != null)
            {
                implementer.SeekAsset(gBlock, new PrvtSeekLis <ContentType> {
                    collLis = collLis, parent = this
                });
                return;
            }
            //stub: should seek asset tool
            else
            {
                collLis.None();
            }
        }
예제 #6
0
 void AssetReferInterface.PickContent <ContentType>(string path, Taker <ContentType> collector)
 {
     if (typeof(ContentType) == typeof(byte[]))
     {
         var field = nameAndUIs.Find((item) => string.Compare(item.name, path, true) == 0);
         if (field != null)
         {
             if (!string.IsNullOrEmpty(field.inputField.text))
             {
                 collector.Take((ContentType)(object)System.Text.Encoding.UTF8.GetBytes(field.inputField.text));
                 return;
             }                     /*else {
                                    *    tasks.Add(()=> {
                                    *            collector.Take((ContentType)(object)System.Text.Encoding.UTF8.GetBytes(field.inputField.text));
                                    *    });
                                    *    return;
                                    * }*/
         }
     }
     collector.None();
 }
예제 #7
0
        public static void DownloadAudio(string url, Taker <AudioClip> taker)
        {
            var downloadHandler = new DownloadHandlerAudioClip(string.Empty, AudioType.WAV);

            downloadHandler.streamAudio = true;
            var www = new UnityWebRequest(url, "GET", downloadHandler, null);

            ProcessWebRequest(
                www,
                (www2) => {
                var wwwe    = www2;
                var content = DownloadHandlerAudioClip.GetContent(www);
                if (content != null)
                {
                    taker.Take(content);
                    return;
                }
                taker.None();
            }
                );
        }
예제 #8
0
파일: StdGAnlys.cs 프로젝트: iwaag/AGBLang
        void GrammarAnalyzer.AnalyzeGrammar(GAnlysInput input, Taker <GrammarBlock> listener)
        {
            var result = new ExpansiveMutableGBlock {
                metaForCluster = StdMetaInfos.sentenceCluster
            };
            Action <GrammarBlock> adder = (gBlock) => result.AddBlock(gBlock);
            var nextInput = input;

            while (true)
            {
                //prepare
                analyzePreparer.Init();
                foreach (var morpheme in nextInput.followings)
                {
                    analyzePreparer.FeedMorpheme(morpheme);
                    if (morpheme.id == 2)
                    {
                        break;
                    }
                }
                var easyLis = new EasyIncrGAnalysListener {
                };
                incrGAnalyzer.Analyze(nextInput, easyLis);
                if (!easyLis.didMatch)
                {
                    break;
                }
                nextInput = easyLis.nextInput;
                easyLis.listener.OnResultRequested(adder);
            }
            if (result.content != null)
            {
                listener.Take(result);
            }
            else
            {
                listener.None();
            }
        }
예제 #9
0
 void AssetReferInterface.PickContent <ElementType>(string path, Taker <ElementType> collector)
 {
     if (string.IsNullOrEmpty(path))
     {
         if (typeof(ElementType) == typeof(BaseMonoBType))
         {
             basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <GameObject> {
                 collector = new PrvtMainColl {
                     coll = new ToBaseTaker <BaseMonoBType, ElementType> {
                         baseTaker = collector
                     }
                 }
             });
         }
         else if (typeof(MonoBehaviour) == typeof(GameObject))
         {
             basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <ElementType> {
                 collector = collector
             });
         }
         else if (typeof(MonoBehaviour) == typeof(ElementType))
         {
             basicAssetIO.assetOut.PickAssetAtPath("Dependencies.json", new StdBridgeBasicColl <ElementType> {
                 collector = collector
             });
         }
         else
         {
             collector.None();
         }
     }
     else
     {
         basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ElementType> {
             collector = collector
         });
     }
 }
예제 #10
0
 /*string FindMainContent() {
  *      foreach (var mainContentPath in basicAssetIO.assetOut.contentPaths) {
  *              foreach (var postFix in parent.mainAssetPostfixs) {
  *                      if (mainContentPath.EndsWith(postFix, StringComparison.CurrentCultureIgnoreCase))
  *                              return mainContentPath;
  *              }
  *      }
  *      return null;
  * }*/
 void AssetReferInterface.PickContent <ElementType>(string path, Taker <ElementType> collector)
 {
     if (string.IsNullOrEmpty(path))
     {
         if (typeof(ElementType) == typeof(MainContentType))
         {
             basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <ElementType> {
                 collector = collector
             });
         }
         else if (typeof(ElementType) == typeof(MainContentBaseType))
         {
             var toBaseTaker = new StdBridgeBasicColl <MainContentType> {
                 collector = new ToBaseTaker <MainContentType, ElementType> {
                     baseTaker = collector
                 }
             };
             basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, toBaseTaker);
         }
         else if (typeof(ElementType) == typeof(AssetRequest))
         {
             basicAssetIO.assetOut.PickAssetAtPath("Dependencies.json", new StdBridgeBasicColl <ElementType> {
                 collector = collector
             });
         }
         else
         {
             collector.None();
         }
     }
     else
     {
         basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ElementType> {
             collector = collector
         });
     }
 }
예제 #11
0
 void Taker <GameObject> .None()
 {
     coll.None();
 }
예제 #12
0
 void AssetBasicTaker <ContentType> .OnFinish()
 {
     collector.None();
 }
예제 #13
0
 void Taker <AssetType> .None()
 {
     externalTaker.None();
 }
예제 #14
0
 void Taker <AssetUnitInfo> .None()
 {
     auIntefaceTaker.None();
 }
예제 #15
0
 void Taker <IEnumerable <BehaverAgent> > .None()
 {
     taker.None();
 }
예제 #16
0
 void AvatarPhysicalizeInterface.Search(GrammarBlock attribute, Taker <IEnumerable <BehaverAgent> > asyncTaker)
 {
     asyncTaker.None();
 }
예제 #17
0
 void Taker <AssetUnitInterface> .None()
 {
     externalTaker.None();
 }
예제 #18
0
 void Taker <ContentType> .None()
 {
     clientColl.None();
 }
예제 #19
0
 void Taker <ItemType> .None()
 {
     clientTaker.None();
     helper.CountDown();
 }
예제 #20
0
 void Taker <GrammarBlock> .None()
 {
     listener.None();
 }