예제 #1
0
    //タイミングと座標と種類番号を引数で敵を生成
    void EnemyGenerate(GenInfo a)
    {
        GameObject enemy;

        //種類分け
        switch (a.kind)
        {
        case 0:
            enemy = GameObject.Instantiate(Resources.Load("Prefabs/Enemy1/赤妖精")) as GameObject;
            //座標
            enemy.transform.position = a.pos;
            break;

        case 1:
            enemy = GameObject.Instantiate(Resources.Load("Prefabs/Enemy1/青妖精")) as GameObject;
            //座標
            enemy.transform.position = a.pos;
            break;

        case 2:
            break;

        case 3:
            break;
        }
    }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("GenInfoID,DestID,Title,subTitle,TextItem1,TextItem2,Image1,Image2")] GenInfo genInfo)
        {
            if (id != genInfo.GenInfoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(genInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GenInfoExists(genInfo.GenInfoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestID"] = new SelectList(_context.Destination, "DestID", "City", genInfo.DestID);
            return(View(genInfo));
        }
예제 #3
0
 internal void AddMergeActions(GenInfo genInfo, List <PostAction> postActions, string searchPattern, bool failOnError)
 {
     Directory
     .EnumerateFiles(GenContext.Current.OutputPath, searchPattern, SearchOption.AllDirectories)
     .ToList()
     .ForEach(f => AddMergePostAction(genInfo, postActions, failOnError, f));
 }
예제 #4
0
 public void Init(GenInfo g)
 {
     _list.Clear();
     _list.Add("System");
     _list.Add("System.Reflection");
     g.InterfaceList.ForEach(AddUsingOf);
 }
예제 #5
0
 internal void AddSearchAndReplaceActions(GenInfo genInfo, List <PostAction> postActions, string searchPattern, bool failOnError)
 {
     Directory
     .EnumerateFiles(genInfo.GenerationPath, searchPattern, SearchOption.AllDirectories)
     .ToList()
     .ForEach(f => postActions.Add(new SearchAndReplacePostAction(genInfo.Template.Identity, new MergeConfiguration(f, GetCodeStyleProvider(f), failOnError))));
 }
        private static void AddPredefinedActions(GenInfo genInfo, TemplateCreationResult genResult, List <PostAction> postActions)
        {
            switch (genInfo.Template.GetTemplateType())
            {
            case TemplateType.Project:
                postActions.Add(new AddProjectToSolutionPostAction(genResult.ResultInfo.PrimaryOutputs));
                postActions.Add(new GenerateTestCertificatePostAction(genInfo.GetUserName()));
                break;

            case TemplateType.Page:
                postActions.Add(new AddItemToProjectPostAction(genResult.ResultInfo.PrimaryOutputs));
                break;

            case TemplateType.Feature:
                postActions.Add(new AddItemToProjectPostAction(genResult.ResultInfo.PrimaryOutputs));
                break;

            case TemplateType.Composition:
                postActions.Add(new AddItemToProjectPostAction(genResult.ResultInfo.PrimaryOutputs));
                break;

            default:
                break;
            }
        }
예제 #7
0
        internal void AddTemplateDefinedPostActions(GenInfo genInfo, TemplateCreationResult genResult, List <PostAction> postActions)
        {
            foreach (var postaction in genResult.ResultInfo.PostActions)
            {
                switch (postaction.ActionId.ToString().ToUpper(CultureInfo.InvariantCulture))
                {
                case GenerateTestCertificatePostAction.Id:
                    postActions.Add(new GenerateTestCertificatePostAction(genInfo.Template.Identity, genInfo.GetUserName(), postaction, genResult.ResultInfo.PrimaryOutputs, genInfo.Parameters, genInfo.DestinationPath));
                    break;

                case AddProjectReferencesToContextPostAction.Id:
                    postActions.Add(new AddProjectReferencesToContextPostAction(genInfo.Template.Identity, postaction, genResult.ResultInfo.PrimaryOutputs, genInfo.Parameters, genInfo.DestinationPath));
                    break;

                case AddNugetReferenceToContextPostAction.Id:
                    postActions.Add(new AddNugetReferenceToContextPostAction(genInfo.Template.Identity, postaction, genInfo.Parameters, genInfo.DestinationPath));
                    break;

                case AddJsonDictionaryItemPostAction.Id:
                    postActions.Add(new AddJsonDictionaryItemPostAction(genInfo.Template.Identity, postaction, genInfo.Parameters, genInfo.DestinationPath));
                    break;

                case AddSdkReferencesToContextPostAction.Id:
                    postActions.Add(new AddSdkReferencesToContextPostAction(genInfo.Template.Identity, postaction, genInfo.Parameters, genInfo.DestinationPath));
                    break;
                }
            }
        }
예제 #8
0
 internal void AddGenerateMergeInfoPostAction(GenInfo genInfo, List <PostAction> postActions)
 {
     Directory
     .EnumerateFiles(GenContext.Current.OutputPath, "*.*", SearchOption.AllDirectories)
     .Where(f => Regex.IsMatch(f, MergeConfiguration.PostactionRegex))
     .ToList()
     .ForEach(f => postActions.Add(new GenerateMergeInfoPostAction(genInfo.Template.Identity, f)));
 }
예제 #9
0
 internal void AddGenerateMergeInfoPostAction(GenInfo genInfo, List <PostAction> postActions)
 {
     Directory
     .EnumerateFiles(Path.GetDirectoryName(genInfo.GenerationPath), "*.*", SearchOption.AllDirectories)
     .Where(f => Regex.IsMatch(f, MergeConfiguration.PostactionRegex) || Regex.IsMatch(f, MergeConfiguration.PostactionAndSearchReplaceRegex))
     .ToList()
     .ForEach(f => postActions.Add(new GenerateMergeInfoPostAction(genInfo.Template.Identity, f)));
 }
예제 #10
0
        internal void AddMergeActions(GenInfo genInfo, List <PostAction> postActions, string searchPattern, bool failOnError)
        {
            var files = Directory
                        .EnumerateFiles(genInfo.GenerationPath, searchPattern, SearchOption.AllDirectories)
                        .ToList();

            files.ForEach(f => AddMergePostAction(genInfo, postActions, failOnError, f));
        }
예제 #11
0
        internal void AddTemplateDefinedPostActions(GenInfo genInfo, TemplateCreationResult genResult, List <PostAction> postActions)
        {
            var genCertificatePostAction = genResult.ResultInfo.PostActions.FirstOrDefault(x => x.ActionId == GenerateTestCertificatePostAction.Id);

            if (genCertificatePostAction != null)
            {
                postActions.Add(new GenerateTestCertificatePostAction(genInfo.Template.Identity, genInfo.GetUserName(), genCertificatePostAction, genResult.ResultInfo.PrimaryOutputs, genInfo.Parameters));
            }
        }
        public override IEnumerable <PostAction> FindPostActions(GenInfo genInfo, TemplateCreationResult genResult)
        {
            var postActions = new List <PostAction>();

            AddPredefinedActions(genInfo, genResult, postActions);
            AddMergeActions(postActions, $"*{MergePostAction.Extension}*", true);

            return(postActions);
        }
예제 #13
0
        public static string SpyFileName(GenInfo g)
        {
            var argsCount = g.Concrete.GetGenericArguments().Length;

            if (argsCount == 0)
            {
                return(g.SpyName);
            }
            return($"{g.SpyName}({argsCount})");
        }
        public GenInfoComposition(GenInfo item)
            : base(item.Name, item.Template)
        {
            foreach (var parameter in item.Parameters)
            {
                Parameters.Add(parameter.Key, parameter.Value);
            }

            LoadFiles();
        }
예제 #15
0
        internal void ExecutePostActions(GenInfo genInfo, TemplateCreationResult generationResult)
        {
            // Get post actions from template
            var postActions = _postactionFactory.FindPostActions(genInfo, generationResult);

            foreach (var postAction in postActions)
            {
                postAction.Execute();
            }
        }
예제 #16
0
        public override IEnumerable <PostAction> FindPostActions(GenInfo genInfo, TemplateCreationResult genResult)
        {
            var postActions = new List <PostAction>();

            AddGetMergeFilesFromProjectPostAction(postActions);
            AddGenerateMergeInfoPostAction(postActions);
            AddMergeActions(postActions, $"*{MergeConfiguration.Extension}*", false);

            return(postActions);
        }
예제 #17
0
 private static void AddMergePostAction(GenInfo genInfo, List <PostAction> postActions, bool failOnError, string f)
 {
     if (IsResourceDictionaryPostaction(f))
     {
         postActions.Add(new MergeResourceDictionaryPostAction(genInfo.Template.Identity, new MergeConfiguration(f, GetCodeStyleProvider(f), failOnError)));
     }
     else
     {
         postActions.Add(new MergePostAction(genInfo.Template.Identity, new MergeConfiguration(f, GetCodeStyleProvider(f), failOnError)));
     }
 }
예제 #18
0
        public GenInfoComposition(GenInfo item)
        {
            Name     = item.Name;
            Template = item.Template;
            foreach (var parameter in item.Parameters)
            {
                Parameters.Add(parameter.Key, parameter.Value);
            }

            LoadFiles();
        }
        public override IEnumerable <PostAction> FindPostActions(GenInfo genInfo, TemplateCreationResult genResult)
        {
            var postActions = new List <PostAction>();

            AddPredefinedActions(genInfo, genResult, postActions);
            AddTemplateDefinedPostActions(genInfo, genResult, postActions);
            AddMergeActions(genInfo, postActions, $"*{MergeConfiguration.Extension}*", true);
            AddSearchAndReplaceActions(genInfo, postActions, $"*{MergeConfiguration.SearchReplaceExtension}*", true);

            return(postActions);
        }
예제 #20
0
파일: GenUI.cs 프로젝트: kirsi0/Hippocampus
    public static void CreateSingleViewCS()
    {
        GameObject prefab   = Selection.activeGameObject as GameObject;
        GenInfo    info     = getPrefabInfo(AssetDatabase.GetAssetPath(prefab));
        string     savePath = "";

        if (!string.IsNullOrEmpty(info.codePath))
        {
            savePath = Application.dataPath.Replace("Assets", "") + info.codePath;
        }
        CreateSingleViewCSByObj(prefab, savePath);
    }
예제 #21
0
        public async Task <IActionResult> Create([Bind("GenInfoID,DestID,Title,subTitle,TextItem1,TextItem2,Image1,Image2")] GenInfo genInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(genInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestID"] = new SelectList(_context.Destination, "DestID", "City", genInfo.DestID);
            return(View(genInfo));
        }
예제 #22
0
    public static void CreatePrCS()
    {
        AssetDatabase.StartAssetEditing();
        GameObject prefab   = Selection.activeGameObject as GameObject;
        GenInfo    info     = getPrefabInfo(AssetDatabase.GetAssetPath(prefab));
        string     savePath = "";

        if (!string.IsNullOrEmpty(info.mediatorPath))
        {
            savePath = Application.dataPath.Replace("Assets", "") + info.mediatorPath;
        }
        CreatePrCSByObj(prefab, savePath);
        AssetDatabase.StopAssetEditing();
        AssetDatabase.Refresh();
    }
예제 #23
0
        internal void AddPredefinedActions(GenInfo genInfo, TemplateCreationResult genResult, List <PostAction> postActions)
        {
            switch (genInfo.Template.GetTemplateOutputType())
            {
            case TemplateOutputType.Project:
                postActions.Add(new AddProjectToContextPostAction(genInfo.Template.Identity, genResult.ResultInfo.PrimaryOutputs, genInfo.Parameters, genInfo.DestinationPath, genInfo.GenerationPath));
                break;

            case TemplateOutputType.Item:
                postActions.Add(new AddItemToContextPostAction(genInfo.Template.Identity, genResult.ResultInfo.PrimaryOutputs, genInfo.Parameters, genInfo.DestinationPath));
                break;

            default:
                break;
            }
        }
예제 #24
0
        internal string GetStatusText(GenInfo genInfo)
        {
            switch (genInfo.Template.GetTemplateType())
            {
            case TemplateType.Project:
                return(string.Format(StringRes.GeneratingProjectMessage, genInfo.Name));

            case TemplateType.Page:
                return(string.Format(StringRes.GeneratingPageMessage, $"{genInfo.Name} ({genInfo.Template.Name})"));

            case TemplateType.Feature:
                return(string.Format(StringRes.GeneratingFeatureMessage, $"{genInfo.Name} ({genInfo.Template.Name})"));

            default:
                return(null);
            }
        }
예제 #25
0
파일: GenUI.cs 프로젝트: kirsi0/Hippocampus
    public static GenInfo getPrefabInfo(string prefabPath)
    {
        Dictionary <string, GenInfo> genInfoDic = getGenInfos();
        string guid = AssetDatabase.AssetPathToGUID(prefabPath);

        if (genInfoDic.ContainsKey(guid))
        {
            return(genInfoDic[guid]);
        }

        var info = new GenInfo(0, prefabPath, "");

        info.GUID        = guid;
        genInfoDic[guid] = info;

        return(info);
    }
예제 #26
0
    private void UpdateUI()
    {
        GenInfo info = GetGenInfo();

        ui.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = "Gen: " + gen;
        ui.transform.GetChild(1).GetComponent <TextMeshProUGUI>().text = "Alive: " + info.numAlive;
        ui.transform.GetChild(2).GetComponent <TextMeshProUGUI>().text = "Current score: " + info.score;
        ui.transform.GetChild(3).GetComponent <TextMeshProUGUI>().text = "Previous score: " + previousScore;
        ui.transform.GetChild(4).GetComponent <TextMeshProUGUI>().text = "Best score: " + bestScore;
        if (info.score > bestScore)
        {
            ui.transform.GetChild(2).GetComponent <TextMeshProUGUI>().color = Color.green;
        }
        else
        {
            ui.transform.GetChild(2).GetComponent <TextMeshProUGUI>().color = Color.red;
        }
    }
예제 #27
0
    //---------------------------------ここから敵の配置と生成タイミング-----------------------------------------

    void Deploy()
    {
        /*
         * if (!generated[番号] && (PlayerPosition(戦闘のx座標 - 11f) || PlayerPosition(最後尾のx座標 + 11f))) {
         *  GenInfo enemy = new GenInfo { pos = new Vector3(生成座標), kind = 種類番号 };
         *  EnemyGenerate(enemy);
         *  generated[番号] = true;
         * }
         *
         * if (!generated[番号] && (PlayerPosition(先頭のx座標 - 11f) || PlayerPosition(最後尾のx座標 + 11f))) {
         *  GenInfo[] enemy = new GenInfo[数];
         *  for(int i = 0; i < 数; i++){
         *      enemy[i] = new GenInfo{ pos = new Vector3(生成座標), kind = 種類番号 };
         *  EnemyGenerate(enemy);
         *  }
         *  generated[番号] = true;
         * }
         */

        //赤
        if (!generated[0] && (PlayerPosition(15f - 10f) || PlayerPosition(15f + 10f)))
        {
            GenInfo redFaily = new GenInfo {
                pos = new Vector3(15f, 2f, 0), kind = 0
            };
            EnemyGenerate(redFaily);
            generated[0] = true;
        }

        //赤3
        if (!generated[1] && (PlayerPosition(17f - 10f) || PlayerPosition(21f + 10f)))
        {
            GenInfo[] enemy = new GenInfo[3];
            for (int i = 0; i < 3; i++)
            {
                enemy[i] = new GenInfo {
                    pos = new Vector3(17f + 2 * i, 2f, 0), kind = 0
                };
                EnemyGenerate(enemy[i]);
            }
            generated[1] = true;
        }
    }
예제 #28
0
파일: Extractor.cs 프로젝트: mjfard/IocSpy
        private SpyGenInfo Exctract(GenInfo g)
        {
            _usingManager.Init(g);
            var ret = new SpyGenInfo
            {
                SpyGenericName     = g.SpyGenericName,
                InterfaceList      = g.InterfaceList.Except(g.InterfaceList.SelectMany(i => i.GetInterfaces())).Select(ReflectionHelper.TypeGenericName).ToList(),
                GenericConstraints = _genericManager.GetTypeConstraints(g.Concrete),
                FileName           = ExtractorMethods.SpyFileName(g),
                MethodInfos        = new List <IMemberInfo>()
            };

            foreach (var @interface in g.InterfaceList)
            {
                var n = @interface.TypeGenericName();
                ret.MethodInfos.AddRange(ProcessInterface(@interface, n));
            }
            ret.Usings = _usingManager.Result;
            return(ret);
        }
예제 #29
0
    // Update is called once per frame
    void Update()
    {
        if (AllDead())
        {
            GenInfo info = GetGenInfo();
            previousScore = info.score;
            if (bestScore < info.score)
            {
                bestScore = info.score;
            }

            MapGenerator mapGenerator = GameObject.Find("Map").GetComponent <MapGenerator>();
            mapGenerator.Clear();
            mapGenerator.Create();
            NewGeneration();
            StartGameLoop();
            Camera.main.transform.position = new Vector3(7.44f, 6, 0);
        }

        UpdateUI();
    }
예제 #30
0
    IEnumerator GenLoop()
    {
        //bStay 가 true 가 될때까지 기달려라
        while (this.bStay == false)
        {
            yield return(null);  //프레임만 계속 넘긴다.
        }
        print("젠시작....!!!!!");


        //젠대기타임 기다리고
        yield return(new WaitForSeconds(startDelayTime));

        do
        {
            //젠사이클 시작
            for (int i = 0; i < this.genInfos.Length; i++)
            {
                //이번에 젠될 정보
                GenInfo genInfo = this.genInfos[i];

                Instantiate(
                    genInfo.genObject,
                    this.transform.position,
                    this.transform.rotation);

                yield return(new WaitForSeconds(
                                 genInfo.nextGenInterval));
            }

            //젠사이클을 하나 뺀다.
            this.genCircleNum--;
        } while (this.genCircleNum != 0);


        //넌 니할일을 다했으니 죽어라
        Destroy(this.gameObject);
    }