コード例 #1
0
ファイル: SMain.cs プロジェクト: coolzoom/mir2-master
        private void rleoadRecipeShopMenuItem_Click(object sender, EventArgs e)
        {
            int u = 0;


            foreach (var NewItem in EditEnvir.RecipeShopContents)
            {
                var OldItem = Envir.RecipeShopContents.Find(x => x.Index == NewItem.Index);
                if (OldItem != null)
                {
                    OldItem = NewItem;
                }
                else
                {
                    Envir.RecipeShopContents.Add(NewItem);
                    u++;
                }
            }

            SMain.Enqueue("[Recipe Shop DataBase] total items :" + Envir.RecipeShopContents.Count.ToString());
            SMain.Enqueue("[Recipe Shop DataBase] " + (Envir.RecipeShopContents.Count - u).ToString() + " has been updated");
            SMain.Enqueue("[Recipe Shop DataBase] " + u.ToString() + " has been added");
        }
コード例 #2
0
ファイル: SMain.cs プロジェクト: coolzoom/mir2-master
        private void craftingReloadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int newCrafts     = 0;
            int updatedCrafts = 0;

            foreach (var craft in EditEnvir.CraftItems)
            {
                CraftItem tmp = Envir.CraftItems.Find(x => x.Recipie == craft.Recipie);
                if (tmp != null)
                {
                    tmp = craft;
                    updatedCrafts++;
                }
                else
                {
                    CraftItem newCraft = craft;
                    Envir.CraftItems.Add(newCraft);
                    newCrafts++;
                }
            }
            SMain.Enqueue("[Recipes] total :" + Envir.CraftItems.Count.ToString());
            SMain.Enqueue(string.Format("[Recipes] Updated : {0} | New Recipes : {1}", updatedCrafts, newCrafts));
            //Envir.LoadCrafts();
        }
コード例 #3
0
ファイル: SMain.cs プロジェクト: coolzoom/mir2-master
        private void magicToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (var NewMagic in EditEnvir.MagicInfoList)
            {
                MagicInfo OldMagic = Envir.MagicInfoList.Find(x => x.Spell == NewMagic.Spell);
                if (OldMagic != null)
                {
                    OldMagic.Copy(NewMagic);
                }
            }

            foreach (var p in Envir.Players)
            {
                foreach (var Magic in Envir.MagicInfoList)
                {
                    p.Enqueue(new S.RefreshMagic {
                        Magic = (new UserMagic(Magic.Spell)).CreateClientMagic()
                    });
                }
            }

            SMain.Enqueue("[Magic DataBase] total magics :" + Envir.MagicInfoList.Count.ToString());
            SMain.Enqueue("[Magic DataBase] " + (Envir.MagicInfoList.Count).ToString() + " has been updated");
        }
コード例 #4
0
ファイル: SMain.cs プロジェクト: coolzoom/mir2-master
        private void monsterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int u = 0;


            foreach (var NewMob in EditEnvir.MonsterInfoList)
            {
                MonsterInfo OldMob = Envir.MonsterInfoList.Find(x => x.Index == NewMob.Index);
                if (OldMob != null)
                {
                    OldMob.UpdateMonster(NewMob);
                }
                else
                {
                    MonsterInfo CloneMonster = MonsterInfo.CloneMonster(NewMob);
                    Envir.MonsterInfoList.Add(CloneMonster);
                    u++;
                }
            }

            SMain.Enqueue("[Monster DataBase] total monsters :" + Envir.MonsterInfoList.Count.ToString());
            SMain.Enqueue("[Monster DataBase] " + (Envir.MonsterInfoList.Count - u).ToString() + " has been updated");
            SMain.Enqueue("[Monster DataBase] " + u.ToString() + " has been added");
        }