@@ -0,0 +1,1503 @@
+package engine;%0A%0Aimport exception.CreateTankException;%0Aimport tank.Tank;%0Aimport tank.TankEnemy;%0Aimport tank.TankUser;%0A%0Aimport java.util.ArrayList;%0A%0Apublic class Engine %7B%0A    private ArrayList%3CTank%3E tankUsers;%0A    private ArrayList%3CTank%3E tankEnemy;%0A%0A    public Engine() %7B%0A        //initilization tanks arrays%0A        this.tankEnemy = new ArrayList%3C%3E();%0A        this.tankUsers = new ArrayList%3C%3E();%0A    %7D%0A%0A    public void run() %7B%0A        //start game in loop%0A    %7D%0A%0A    public void init(int users, int enemy) throws CreateTankException %7B%0A        //create tanks users%0A        if (!this.createUsersTanks(users)) %7B%0A            throw new CreateTankException(%22Cannot be created users!%22);%0A        %7D%0A%0A        //create tanks enemy%0A        if (!this.createEnemyTanks(enemy)) %7B%0A            throw new CreateTankException(%22Cannot be created users!%22);%0A        %7D%0A%0A        //create map%0A    %7D%0A%0A    private boolean createUsersTanks (int numberOfUsers) %7B%0A        if (numberOfUsers %3C= 0) %7B%0A            return false;%0A        %7D%0A%0A        for (int i = 1; i %3C= numberOfUsers; i++) %7B%0A            String user = %22user%22 + i;%0A            this.tankUsers.add(new TankUser(user));%0A        %7D%0A%0A        return true;%0A    %7D%0A%0A    private boolean createEnemyTanks (int numbersOfEnemy) %7B%0A        if (numbersOfEnemy %3C= 0) %7B%0A            return false;%0A        %7D%0A%0A        for (int i = 1; i %3C= numbersOfEnemy; i++) %7B%0A            String enemy = %22enemy%22 + i;%0A            this.tankEnemy.add(new TankEnemy(enemy));%0A        %7D%0A%0A        return true;%0A    %7D%0A%7D%0A

create engine