Exemple #1
0
    public override Level Clone()
    {
        Enemy enemy = new Enemy(LevelPicID, CloneVariantUtils.SortedDictionary(LevelNames), DifficultyLevel, BuildInfo.Clone(), EnemyType, CloneVariantUtils.List(BonusGroups), CloneVariantUtils.List(CardComboList), CardPriority);

        enemy.LevelID = LevelID;
        return(enemy);
    }
    private ScriptExecuteSettingBase CloneCore(bool withChange)
    {
        Assembly assembly             = AllScriptExecuteSettings.CurrentAssembly; // 获取当前程序集
        ScriptExecuteSettingBase copy = (ScriptExecuteSettingBase)assembly.CreateInstance("ScriptExecuteSettings." + Name);

        copy.Name                    = Name;
        copy.DescRaws                = CloneVariantUtils.SortedDictionary(DescRaws);
        copy.TriggerTime             = TriggerTime;
        copy.TriggerRange            = TriggerRange;
        copy.TriggerTimes            = TriggerTimes;
        copy.TriggerDelayTimes       = TriggerDelayTimes;
        copy.RemoveTriggerTime       = RemoveTriggerTime;
        copy.RemoveTriggerRange      = RemoveTriggerRange;
        copy.RemoveTriggerTimes      = RemoveTriggerTimes;
        copy.RemoveTriggerDelayTimes = RemoveTriggerDelayTimes;
        if (withChange)
        {
            copy.M_SideEffectParam = M_SideEffectParam.CloneWithFactor();
        }
        else
        {
            copy.M_SideEffectParam = M_SideEffectParam.Clone();
        }
        return(copy);
    }
Exemple #3
0
    public override Level Clone()
    {
        Shop shop = new Shop(LevelPicID, CloneVariantUtils.SortedDictionary(LevelNames), DifficultyLevel, CloneVariantUtils.List(ShopItems), ShopItemCardCount, ShopItemOthersCount);

        shop.LevelID = LevelID;
        return(shop);
    }
Exemple #4
0
    public Story Clone()
    {
        SortedDictionary <int, BuildInfo> newPlayerBuildInfos = CloneVariantUtils.SortedDictionary(PlayerBuildInfos);

        foreach (KeyValuePair <int, BuildInfo> kv in newPlayerBuildInfos)
        {
            kv.Value.BuildID = kv.Key;
        }

        SortedDictionary <int, Chapter> newChapters = CloneVariantUtils.SortedDictionary(Chapters);

        foreach (KeyValuePair <int, Chapter> kv in newChapters)
        {
            kv.Value.ChapterID = kv.Key;
        }

        SortedDictionary <int, bool> cardUnlockInfos = CloneVariantUtils.SortedDictionary(CardUnlockInfos);

        Story newStory = new Story(
            StoryName,
            newChapters,
            newPlayerBuildInfos,
            cardUnlockInfos,
            StoryGamePlaySettings.Clone(),
            0);

        return(newStory);
    }
Exemple #5
0
 public ExecutorInfo Clone()
 {
     return(new ExecutorInfo(
                ClientId,
                SideEffectExecutorID,
                MechId,
                CardId,
                CardInstanceId,
                EquipId,
                CloneVariantUtils.List(TargetClientIds),
                CloneVariantUtils.List(TargetMechIds),
                CloneVariantUtils.List(TargetCardInstanceIds),
                CloneVariantUtils.List(TargetEquipIds),
                CloneVariantUtils.SortedDictionary(ValueDictionary),
                IsPlayerBuff));
 }
    private SideEffectBase CloneCore(bool withChange)
    {
        Assembly       assembly = AllSideEffects.CurrentAssembly; // 获取当前程序集
        SideEffectBase copy     = (SideEffectBase)assembly.CreateInstance("SideEffects." + Name);

        copy.Name     = Name;
        copy.DescRaws = CloneVariantUtils.SortedDictionary(DescRaws);
        if (withChange)
        {
            copy.M_SideEffectParam = M_SideEffectParam.CloneWithFactor();
        }
        else
        {
            copy.M_SideEffectParam = M_SideEffectParam.Clone();
        }
        copy.Sub_SideEffect = CloneVariantUtils.List(Sub_SideEffect);
        return(copy);
    }
Exemple #7
0
    public Chapter Variant()
    {
        SortedDictionary <int, Level>          levels    = RandomizeLevelPosition();
        SortedDictionary <int, HashSet <int> > routes    = GenerateMazeRoutesByAllRoutes(levels);
        SortedDictionary <int, HashSet <int> > allRoutes = new SortedDictionary <int, HashSet <int> >();

        foreach (KeyValuePair <int, HashSet <int> > kv in AllRoutes)
        {
            HashSet <int> set = new HashSet <int>();
            foreach (int i in kv.Value)
            {
                set.Add(i);
            }

            allRoutes.Add(kv.Key, set);
        }

        return(new Chapter(ChapterID, CloneVariantUtils.SortedDictionary(ChapterNames), levels, ChapterMapRoundCount, allRoutes, routes: routes));
    }
Exemple #8
0
    public Chapter Clone()
    {
        SortedDictionary <int, Level> levels = CloneVariantUtils.SortedDictionary(Levels);

        foreach (KeyValuePair <int, Level> kv in levels)
        {
            kv.Value.LevelID = kv.Key;
        }

        SortedDictionary <int, HashSet <int> > allRoutes = new SortedDictionary <int, HashSet <int> >();

        foreach (KeyValuePair <int, HashSet <int> > kv in AllRoutes)
        {
            HashSet <int> set = new HashSet <int>();
            foreach (int i in kv.Value)
            {
                set.Add(i);
            }

            allRoutes.Add(kv.Key, set);
        }

        SortedDictionary <int, HashSet <int> > routes = new SortedDictionary <int, HashSet <int> >();

        foreach (KeyValuePair <int, HashSet <int> > kv in Routes)
        {
            HashSet <int> set = new HashSet <int>();
            foreach (int i in kv.Value)
            {
                set.Add(i);
            }

            routes.Add(kv.Key, set);
        }

        return(new Chapter(ChapterID, CloneVariantUtils.SortedDictionary(ChapterNames), levels, ChapterMapRoundCount, allRoutes, routes: routes));
    }