@@ -0,0 +1,2491 @@
+/*%0D%0A * Copyright 2015 KonradOliwer.%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *      http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0Apackage pwr.om.geneticai.geneticalgorithm.fitensfunction.variable;%0D%0A%0D%0Aimport java.util.logging.Level;%0D%0Aimport java.util.logging.Logger;%0D%0Aimport pwr.om.battlesystem.actor.Actor;%0D%0Aimport pwr.om.battlesystem.ai.EnchantedRandomAI;%0D%0Aimport pwr.om.geneticai.chromosome.ChromosomeFactory;%0D%0Aimport pwr.om.geneticai.geneticalgorithm.fitensfunction.EnemyFactory;%0D%0Aimport pwr.om.geneticai.geneticalgorithm.fitensfunction.RandomActorsFactory;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author KonradOliwer%0D%0A */%0D%0Apublic class RandomAIEnemyFactory implements EnemyFactory %7B%0D%0A%0D%0A    private Actor%5B%5D%5B%5D enemies;%0D%0A%0D%0A    public RandomAIEnemyFactory(ChromosomeFactory chromosomeFactory) %7B%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public Actor%5B%5D%5B%5D getEnemies(int%5B%5D%5B%5D population, int%5B%5D distribution, Actor testedActor) %7B%0D%0A        lasyInitEnemies(population, distribution);%0D%0A        return enemies;%0D%0A    %7D%0D%0A%0D%0A    private void lasyInitEnemies(int%5B%5D%5B%5D population, int%5B%5D distribution) %7B%0D%0A        if (enemies == null) %7B%0D%0A            enemies = new Actor%5Bdistribution.length%5D%5B%5D;%0D%0A            enemies%5B0%5D = RandomActorsFactory.generateActors(distribution%5B0%5D);%0D%0A            for (int i = 1; i %3C enemies.length; i++) %7B%0D%0A                enemies%5Bi%5D = new Actor%5Bdistribution%5Bi%5D%5D;%0D%0A                for (int j = 0; j %3C distribution%5Bi%5D; j++) %7B%0D%0A                    try %7B%0D%0A                        enemies%5Bi%5D%5Bj%5D = enemies%5B0%5D%5Bj%5D.clone();%0D%0A                    %7D catch (CloneNotSupportedException ex) %7B%0D%0A                        Logger.getLogger(RandomAIEnemyFactory.class.getName()).log(Level.SEVERE, null, ex);%0D%0A                    %7D%0D%0A                %7D%0D%0A            %7D%0D%0A            EnchantedRandomAI randomAI = new EnchantedRandomAI();%0D%0A            for (int i = 0; i %3C enemies.length; i++) %7B%0D%0A                for (int j = 0; j %3C enemies%5Bi%5D.length; j++) %7B%0D%0A                    enemies%5Bi%5D%5Bj%5D.setAI(randomAI);%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D%0D%0A    %7D%0D%0A%7D%0D%0A

Add RandomAIEnmyFactory