private void Multiply_DS3(List <Enemy_DS3> originalEntries, List <Enemy_DS3> randomizableEntries, List <EnemyWrapper_DS3> associatedWrappers) { for (int i = randomizableEntries.Count - 1; i > -1; i--) { for (int j = 1; j < _multiplier; j++) { Enemy_DS3 clone = randomizableEntries[i].Clone(); originalEntries.Add(clone); randomizableEntries.Add(clone); associatedWrappers.Add(clone.GetWrapper <EnemyWrapper_DS3, Enemy_DS3>()); } } }
public static T Clone <T>(this T entry) where T : class { if (typeof(T) == typeof(DS3Enemy)) { DS3Enemy enemy = entry as DS3Enemy; return(new DS3Enemy(enemy) { Name = enemy.Name + POSTFIX_CLONE } as T); } if (typeof(T) == typeof(SekiroEnemy)) { SekiroEnemy enemy = entry as SekiroEnemy; return(new SekiroEnemy(enemy) { Name = enemy.Name + POSTFIX_CLONE } as T); } throw new Exception("rua"); }